This is a demo project that demonstrates how AES-based encryption & decryption workes on the code.
Hopefully this will be helpful to understand the basic process of the end-to-end data security between web pages and server application.
(It may require additional package installation.)
- Create secret key with the algorithm like SHA-256 hashing.
- Additional (blank) buffers will be padded at the end of the original data to make sure the whole data length will be multiple of the block size. (mostly 16)
- Encrypt the data above with secret key & IV(Initialization Vector) data. (IV is used for the encryption during the block initialization)
- Combine IV & encrypted data in base64 format as the result.