Powerful php encryption and decryption extension: cryptopp

Source: Internet
Author: User
Powerful php encryption/decryption extension: cryptopp is a powerful encryption/decryption extension written in c ++. excellent performance and reliability. all encryption and decryption classes written in PHP can be replaced. moreover, the programming interfaces provided by PHP are very simple and easy to use.

The extended cryptopp interface 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 for special instructions, and the method name is clear at a glance.


Encode and decode correspond to AES encryption and decryption respectively.

The usage is simple:

$key = "key";$cryptopp = new cryptopp($key);$str = "1234567890";$tmp = $cryptopp->encode($str);header('content-type:text/html;charset=utf-8');echo $str.'
';echo $tmp.'
';echo $cryptopp->decode($tmp);



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

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



: Https://drive.google.com/file/d/0B2RkHfVa7EtzSWItWkFIV2FPbGM/view? Usp = sharing

Cryptopp extensions are compiled and used on 64-bit ubuntu and are not suitable for 32-bit systems. Currently, the 32-bit version is not provided. Windows is unavailable. Whether it can be used in other 64-bit linux systems is not tested and unknown.

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.