PHP sample code for symmetric and asymmetric cryptography with encryption and decryption
It's a simple implementation of handing encryption and decryption with AES symmetric-key algorithm between two side, PHP server and Javascript client.
Download repository and run Composer install in your Web directory:
$ git clone https://github.com/yidas/crypto-sample-php;
$ cd crypto-sample-php;
$ composer install;
Advanced Encryption Standard (AES), a subset of the Rijndael cipher, which is a symmetric-key algorithm, meaning the same key is used for both encrypting and decrypting the data.
-
ECB - Same cipher text with same plain text. No use of IV.
-
CBC - Different cipher text with same plain text. Using IV. (The most commonly used mode of operation)