<?php
/**
* A Compatibility library with PHP 5.5's simplified password hashing API.
*
* @author Anthony Ferrara <ircmaxell@php.net>
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @copyright 2012 The Authors
*/
namespace {
if (!defined('PASSWORD_BCRYPT')) {
/**
* PHPUnit Process isolation caches constants, but not function declarations.
* So we need to check if the constants are defined separately from
* the functions to enable supporting process isolation in userland
* code.
*/
define('PASSWORD_BCRYPT', 1);
define('PASSWORD_DEFAULT', PASSWORD_BCRYPT);
define('PASSWORD_BCRYPT_DEFAULT_COST', 10);
} I believe that when many PHP developers first came into contact with PHP, the preferred encryption function for handling passwords might be MD5. This is what I did at the time: $password = md5($_POST["password "]);Does the above code sound familiar? However, the MD5 encryption method seems to be not very popular in the PHP world at present, because its encryption algorithm is a bit simple, and many password cracking sites store a lot of MD5 encrypted password strings, so here I strongly discourage using MD5 alone to encrypt user passwords. SHA256 and SHA512In fact, there is a SHA1 encryption method at the same time as the previous MD5, but the algorithm is relatively simple, so I will briefly mention it here. The SHA256 and SHA512 we are about to talk about here are encryption functions from the SHA2 family. You may have guessed it by looking at the names. These two encryption methods generate hash strings of 256 and 512 bit length respectively.
Encryption and decryption class library53332017-12-19
Encryption process:
Read the source file, encrypt it with base64_encode, and use the 52 uppercase and lowercase letters obtained by shuffling as the secret key for replacement
$c=strtr (ciphertext, corresponding to the letter to be replaced, the letter to be replaced);
Link the two secret keys and the ciphertext to form the main content of the file to be encrypted
Finally, according to the template format written in advance, combine the base64_decode, strtr, and substr commands respectively, and put the combined ciphertext into the template and base64_encode the encryption here,
Write the file to be encrypted.
Encryption and decryption class library48532017-11-14
Encryption and decryption processing class implemented by php
Encryption and decryption class library75512017-11-03
PHP encryption and decryption practical class free download
Encryption and decryption class library66372017-07-14
Introducing a php-RAS encryption code, Signature and ciphertext encoding: base64 string/hex string/binary string stream,Padding method: PKCS1Padding (encryption and decryption)/NOPadding (decryption), If the key length is 1024 bits, the data must be less than 128 bytes during encryption, plus PKCS1Padding itself 11 bytes of information, so the plain text must be less than 117 bytes
Encryption and decryption class library51802017-06-20
Share a php symmetric encryption algorithm DES and AES class, Supported keys: 64/128/256 bit (byte length 8/16/32), Supported algorithm: DES/AES (automatic matching based on key length: DES: 64bit AES: 128/256bit), Supported mode: CBC/ECB/ OFB/CFB, Ciphertext encoding: base64 string/hex string/binary string stream, Padding method: PKCS5Padding (DES). ##
Encryption and decryption class library53252017-06-20
Share a symmetric encryption algorithm class provided by PHP. KEY is a previously defined constant Mcrypt::encrypt(); Mcrypt::decrypt();
Encryption and decryption class library44022017-06-08
Share a PHP encryption and decryption class. The ciphertext validity period is valid during encryption. The unit is seconds. 0 is permanently valid.
Encryption and decryption class library41522017-05-25
Share a standard PHP AES encryption algorithm class, including mcrypt_get_block_size('rijndael-128', 'ecb');. If it is easier to make a mistake without understanding the principle, you can check the encryption you need through the mcrypt_list_algorithms function. Algorithm ID.
Encryption and decryption class library48482017-05-25
Share a powerful PHP encryption and decryption class. The construction parameter is the key and performs some encryption and decryption operations on strings.
Encryption and decryption class library52772017-05-23
Introducing a php encryption and decryption utility class, If you want to retrieve the original password for the user when he or she forgets it, then this class is a useful tool. Passwords registered by users are generally not saved in plain text and must be encrypted first. The simplest is of course to call the md5 function in the database sql statement to encrypt the user password. Here we introduce an encryption and decryption class. This class is a useful tool if you want to retrieve a user's original password when he or she forgets it. Of course, this encryption and decryption class can also be used for other purposes.
Encryption and decryption class library44632017-05-23
Introducing a relatively complete php encryption and decryption function class.
Encryption process:
Read the source file, encrypt it with base64_encode, and use the 52 uppercase and lowercase letters obtained by shuffling as the secret key for replacement
$c=strtr (ciphertext, corresponding to the letter to be replaced, the letter to be replaced);
Link the two secret keys and the ciphertext to form the main content of the file to be encrypted
Finally, according to the template format written in advance, combine the base64_decode, strtr, and substr commands respectively, and put the combined ciphertext into the template and base64_encode the encryption here,
Write the file to be encrypted.
Decryption process:
Read the file to be decrypted, intercept the string starting with eval, and then intercept hierarchically to obtain the ciphertext generated in the encryption template
base64_decode decryption to obtain the decrypted plaintext
Intercept the obtained name text, intercept the characters of the secret key ciphertext formed by the source file, and execute the intercepted characters through eval to assign the ciphertext to the predefined variable ($O0O000)
By executing base64_decode(strtr(substr($O0O000,52*2),substr($O0O000,52,52),substr($O0O000,0,52)));
Decrypt and write the decrypted content (plain text) to the file.
Encryption and decryption class library43712017-05-23