Summary of the use of php encryption extension mcrypt

Source: Internet
Author: User
Tags mcrypt
The php language comes with many encryption and decryption methods and extensions. today we will introduce one of the extended mcrypt extensions, which encapsulates common encryption algorithms. In fact, this extension is the encapsulation of the standard mcrypt class library. mcrypt has completed a lot of common encryption algorithms, such as DES, TripleDES, and php language which comes with many encryption and decryption methods and extensions, today we will introduce an extension. McryptExtended, mcrypt extended to complete the encapsulation of common encryption algorithms. In fact, the extension is the encapsulation of mcrypt standard class library, mcrypt completed a lot of common encryption algorithms, such as DES, TripleDES, Blowfish (default), 3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 and GOST encryption algorithms, and provides four block encryption models: CBC, OFB, CFB, and ECB. This article summarizes the usage of mcrypt extensions.

Mcrypt extended usage

1. PHP encrypted Extension Library-Mcrypt Extension Library instance usage

Mcrypt supports the following four group password modes: CBC, OFB, CFB, and ECB. If you are using a libmcrypt-2.4.x or a later version of the link, you can also support nOFB group mode and stream mode. The following are supported encryption modes and their predefined constants.

3. use apt-get install in ubuntu to install the php Extension Library mcrypt, curl, and gd.

Ubuntu software package download and installation tool: apt-get is very easy to use, and the Ubuntu Software source provides most of the commonly used software packages, so, installing the php Extension Library mcrypt, curl, and gd in Ubuntu is very simple. you can run the following command to automatically complete the installation: (The following installation prerequisite is that PHP5 is installed in the system)

4. php fails to load mcrypt. dll. how can this problem be solved?

Php loads mcrypt. dll failure solution: 1. php. search for extension = php_mcrypt.dll in ini and remove the semicolon (;) to restart apache. invalid (note: php. ini in the dinwos directory ). 2. copy libmcrypt. dll in the php directory to the windows/system32 directory and restart IIS. 3. Another method is to copy libmcrypt. dll to the bin directory of apache to take effect.

5. Analysis of PHP mcrypt reversible encryption algorithm

Data encryption has become more and more important in our lives, especially considering the large amount of data that has been traded and transmitted over the Internet. For information that does not need to be restored to the original data, we can use MD5, sha1 and other irreversible encryption algorithms to encrypt the data, however, you must use a recoverable encryption algorithm to encrypt important information such as transaction information that needs to be restored to the original data. Of course, you can write a reversible encryption algorithm for encryption and decryption computing. This article describes how to use the mcrypt module for encryption and decryption.

6. when phpMyAdmin fails to load the mcrypt extension, check the PHP configuration solution.

The Mysql database is not correctly installed, and Mysql-related services are not started in the system service (please check the correct method for installing Mysql)

Libmcrypt is missing in the system system32 (C: \ windows \ system32) directory. dll file. the solution is to find libmcrypt under the php directory. dll, and libmcrypt. copy the dll to the C: \ windows \ system32 directory and restart the Web service.

Related Q &

1. how can I solve the following problems when installing mcrypt PHP in linux?

2. enable Mcrypt PHP extension

4. how can I enable php-mcrypt?

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.