aes-256 example
AES-256 No Mode
can only encrypt/decrypt 16 bytes of data.
I have the following AES-256 mode examples,
GitHub Webpage
RUN
run aes.go
Your output should be,
Original Text: Hello Jeff, only 16 Bytes of this will be encrypted.
The 32-byte Key: myverystrongpasswordo32bitlength
Encrypted Text: 1d3288a55c1b74826395bd823d7cf0a2
Decrypted Text: Hello Jeff, only
HOW IT WORKS
This example is simple and very limiting and has no mode
.
It will only encrypt 16 bytes of data.
Encryption,
// ENCRYPT DATA
block.Encrypt(cipherTextByte, plaintextByte)
Decryption,
// DeCRYPT DATA
block.Decrypt(plainTextByte, cipherTextByte)
This illustration may help,