Sort articles by: Date | Most Rates | Most Views | Comments | Alphabet

Front-end CryptoJS AES/DES encryption and decryption and back-end PHP AES/DES encryption and decryption

Author: bamboo06 on 15-07-2020, 15:49, views: 4571

0 Today we will focus on front-end encryption. Some projects involve more sensitive data, and developers will require the front end to encrypt the data before transmitting it to the back end for decryption processing. Although https has actually played a great role in protecting data transmission, for users who do not use https, front-end encryption still has a certain significance.
Front-end CryptoJS AES/DES encryption and decryption and back-end PHP AES/DES encryption and decryption

This article involves:
The front end uses CryptoJS to encrypt and decrypt DES or AES data;
The backend uses PHP openssl to decrypt and encrypt the data.

Category: PHP Scripts

 

PHP errors and exception handling

Author: bamboo06 on 9-06-2020, 20:26, views: 1022

0 Unlike other programming languages ​​that throw exceptions when encountering errors, PHP also has an exception mechanism when handling objects, but PHP will perform as happily as possible and ignore what happened, unless it encounters an extremely serious error. There is an exception. This article outlines PHP-related error exception handling mechanisms.
PHP errors and exception handling

PHP has several error severity levels. The three most common types of information are errors, notices, and warnings. They have different severity: E_ERROR, E_NOTICE and E_WARNING. The error is a serious problem during operation, usually caused by code error, it must be corrected, otherwise PHP will stop execution. Notifications are information of a recommended nature, because the program code may cause problems during execution, but the program will not stop. The warning is a non-fatal error, and program execution will not be aborted.

Category: PHP Scripts

 

PHP and UTF-8

Author: bamboo06 on 14-08-2019, 18:43, views: 2388

0 When working with the Unicode character set, use the corresponding function instead of the native string function. For example, if a file is encoded as UTF-8 PHP code, if the strlen() function is wrong, use the mb_strlen() function instead.
PHP and UTF-8

If you use substr to intercept Chinese characters, garbled characters will appear, because substr is intercepted in bytes. That is, UTF-8 encoded Chinese, using substr interception, will only intercept 1/3 Chinese, of course, garbled. When UTF-8 is encoded, a Chinese character is 3 bytes. Similarly, different languages in other countries will produce multi-byte strings, so we use mb_strlen() to handle them.

Category: PHP Scripts

 

PHP security of the password hashing

Author: bamboo06 on 14-08-2019, 18:29, views: 903

0 Never know the user's password, we must encrypt the user's password, and can not save the user's original password directly in the database. Do not limit the user password format. If the format is specified, it may be exploited and cracked by the attacker. Of course, we need to limit the minimum length of the password. It is recommended to use at least 8 bits. The longer the better.
PHP security of the password hashing

For password security, developers need to:
1, absolutely can not know the user's password, we must encrypt the user's password, can not save the user's original password directly in the database.
2, do not limit the user password format, if the format is specified, it is likely to be exploited and cracked by the attacker, of course, we need to limit the minimum length of the password, it is recommended to at least 8 bits, the longer the better.
3, can not send the user password through the mailbox, when we develop the application to retrieve the password, the user password is not notified to the user by email, but the link to reset the password is sent to the user in the form of mail, let the user Go to reset the password.

Category: PHP Scripts

 

PHP security data filtering and verification

Author: bamboo06 on 28-07-2019, 18:26, views: 1152

0 Never trust external input, don't trust any data from a data source that is not under your direct control. In actual development, there is always someone intentionally or unintentionally injecting dangerous data into PHP code, so PHP security programming becomes important. Generally, we deal with external input security ideas: filtering input and verifying data.
PHP security data filtering and verification

Filtering input means escaping or deleting characters that are not safe from external data.

Category: PHP Scripts

 

PHP+Crontab performs scheduled tasks

Author: bamboo06 on 28-07-2019, 18:16, views: 942

0 When we do web project development, we often need to periodically back up data, periodically restart a service or periodically execute a PHP program, etc., generally use Crontab under Linux and use scheduled tasks under Windows. This article focuses on the basics of using Crontab under Linux and performing PHP tasks.
PHP+Crontab performs scheduled tasks

Crontab is a commonly used timing execution tool for Unix/Linux systems that runs specified jobs without human intervention.

Category: PHP Scripts

 

PHP+Crontab performs scheduled tasks

Author: bamboo06 on 21-04-2019, 02:03, views: 1136

0 When we do web project development, we often need to periodically back up data, periodically restart a service or periodically execute a PHP program, etc., generally use Crontab under Linux and use scheduled tasks under Windows. This article focuses on the basics of using Crontab under Linux and performing PHP tasks.
PHP+Crontab performs scheduled tasks

Crontab is a commonly used timing execution tool for Unix/Linux systems that runs specified jobs without human intervention.

Category: PHP Scripts / Apps

 

basicContext.js - Add a powerful context (right-click) menu to your web application

Author: bamboo06 on 15-02-2019, 01:27, views: 1665

0 basicContext.js is a powerful pure Js context menu plugin. The js context menu plugin can make a left-click menu, a right-click menu, and can customize the location of the menu. It supports all modern browsers, including the mobile side, and it can also be used in conjunction with jquery.
basicContext.js - Add a powerful context (right-click) menu to your web application

The basicContext.js plugin can be installed via bower or npm.

Category: PHP Scripts / Javascript / Plugins

 

PHP PSR-4 Autoloader

Author: bamboo06 on 15-02-2019, 00:56, views: 1167

0 Prior to PSR-4, PHP components and frameworks used the magic method _autoload() or spl_autoload_register() to implement their own autoloaders, so we learned to use each component and framework's unique autoloader, and Nowadays, everyone follows PSR-4, which means we can mix and match multiple PHP components with just one autoloader.
PHP PSR-4 Autoloader

The PHP framework works with an automatic loading mechanism. Autoloading is the process by which the PHP interpreter automatically finds and loads PHP classes as needed at runtime. This is an amazing feature that links many interoperable components of the modern PHP ecosystem.

Category: PHP Scripts

 

PHP PSR-3 Log Interface Specification

Author: bamboo06 on 2-02-2019, 17:34, views: 2013

0 The main purpose of this specification is to allow the log class library to log information in a simple and generic way by receiving a PsrLogLoggerInterface object. The framework and the CMS content management system can extend this interface if necessary, but this specification is required to ensure that the log interface can still be properly connected when using third-party class library files. This article develops a generic interface specification for the log class library.
PHP PSR-3 Log Interface Specification

The implementers in this article refer to the class libraries or frameworks that implement the LoggerInterface interface. Conversely, they are the users of LoggerInterface.

Category: PHP Scripts

 
Previous Next