In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
AES introduces the Advanced encryption Standard (Advanced Encryption Standard, abbreviation: AES), which is also called Rijndael encryption method in cryptography. It is a block encryption standard adopted by the federal government of the United States.
This standard, which is used to replace the original DES, has been analyzed by many parties and is widely used all over the world.
After a five-year selection process, the Advanced encryption Standard was issued by the National Institute of Standards and Technology (NIST) in FIPS PUB 197 on November 26th, 2001, and became a valid standard on May 26th, 2002.
In 2006, the advanced encryption standard has become one of the most popular algorithms in symmetric key encryption.
Class AES {public $method ='; public $key =''; public $iv =''; public function _ _ construct (string $method, string $key, string $iv) {if (! in_array ($method, openssl_get_cipher_methods () {throw new\ Exception ($method. ' Encryption method is not support.');} $this- > method = $method; $this- > key = $key; $this- > iv = $iv;} / / AES encryption public function aesEncryption (string $data): string {$result = openssl_encrypt ($data, $this- > method, $this- > key, OPENSSL_RAW_DATA, $this- > iv); return base64_encode ($result) } / / AES decryption public function aesDecryption (string $data): string {return openssl_decrypt (base64_decode ($data), $this- > method, $this- > key, OPENSSL_RAW_DATA, $this- > iv);} $config = ['AES-128-CBC1', / / method encryption # AES-256-CBC, etc.' helloworld', / / key encryption key md5 (time ()). Uniqid (), true), / / iv guarantee offset is 16 bits]; try {$obj = new AES (. $config); echo $encryptionResult = $obj- > aesEncryption ('Jack'). PHP_EOL; echo $decryptionResult = $obj- > aesDecryption ($encryptionResult). PHP_EOL;} catch (\ Exception $e) {exit ($e-> getMessage () .PHP_EOL);}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.