Super PHP plus decryption extension: Cryptopp

Source: Internet
Author: User
Tags sha1

Cryptopp is a hyper-imposed decryption extension written in C + +. Excellent performance and reliability. It is completely possible to replace all of the encryption and decryption classes written by PHP. Not only that, but it provides a very concise and easy to use programming interface, it is the PHP programmer must extend.

The interface for the Cryptopp extension is as follows:


Class Cryptopp {public    function __construct ($param);    Public Function Setkey ($param);    Public function encode ($param);    Public function decode ($param);    public static function Enhex ($param);    public static function Dehex ($param);    public static function Enbase64 ($param);    public static function Debase64 ($param);    public static function Enbase32 ($param);    public static function Debase32 ($param);    public static function MD5 ($PARAM);    public static function SHA1 ($param);    public static function sha256 ($param);    public static function sha512 ($param);}



In addition to the encode and decode methods, there is no need to specifically specify the method name at a glance.


Encode/decode respectively corresponds to AES plus decryption.

The way to use it is simple:

$key = "key"; $cryptopp = new Cryptopp ($key); $str = "1234567890"; $tmp = $cryptopp->encode ($str); header (' Content-type: Text/html;charset=utf-8 '), echo $str. ' <br/> '; Echo $tmp. ' <br/> '; Echo $cryptopp->decode ($tmp);



The use of other static methods is much simpler, so it's OK:

$str = "1234567890"; cryptopp::md5 ($STR); Cryptopp::sha1 ($STR); cryptopp::sha256 ($STR);



: https://drive.google.com/file/d/0B2RkHfVa7EtzSWItWkFIV2FPbGM/view?usp=sharing

The Cryptopp extension is compiled on 64-bit Ubuntu and is not suitable for 32-bit systems. 32-bit version is not available. Windows is not available. Can be used for other 64-bit Linux systems, not tested, unknown.

Super PHP plus decryption extension: Cryptopp

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.