Function type: Encoding processing &http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP; Content Description
This function uses the CFB cipher retrieval (cipher feedback) to encrypt and decrypt the data. parameter cipher to add/decrypt method, such as Mcrypt_tripledes. Parameter key is the key to the password, of course, keep it confidential. The string to encrypt or decrypt is placed in parameter data. Parameter mode indicates the encryption Mcrypt_encrypt or decryption mcrypt_decrypt. The parameter IV is representative of vector initialization (initialization vector, IV).
To use this function library to prepare the MCrypt program, you can download the program to Ftp://argeas.cs-net.gr/pub/unix/mcrypt libmcrypt-x.x.tar.gz. At the same time in compiling PHP program needs to add--with-mcrypt options, so that the function library to operate smoothly. This function provides the encoding of DES, TripleDES, Blowfish (default), 3-way, safer-sk64, safer-sk128, Twofish, tea, RC2, and the use of CBC, OFB, CFB, and ECB for password retrieval GOST. In addition, RC6 and idea are not free coding methods. See listed below as defined passwords:
In the area of password retrieval (cipher), this library supports four cipher searches of CBC, OFB, CFB and ECB. The simple description of these four cipher searches is as follows, please refer to Schneier's Applied Cryptography (ISBN:0-471-11709-9) For more detailed information:
ECB (Electronic codebook): Suitable for random data, such as using another key. Using the ECB is less appropriate if the volume of data is small and random. CBC (cipher block Chaining): For file encryption, security is better than the ECB. CFB (cipher feedback): Suitable for encrypting a segment of independent bit data (single bytes) in a bit-group stream. OFB (output feedback): Compatible with CFB, especially for applications that cannot tolerate error ripple. PHP is still unable to encrypt the unit (bit) entropy to decrypt the steps, currently only suitable for the string for password processing.
When using the two modes of CFB and OFB, vector initialization (initialization vector, IV) is required, and the CBC mode can also be initialized using vectors. The value of the vector initialization must be unique and remain the same while decrypting. When the data output is encrypted, the password key can also be output simultaneously (for example, in a file), or the value initialized by the vector can be exported with the encrypted data.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.