AES

This program will encrypt and decrypt a file using a key, which is basically a 32-byte (256-bit) password.

When generating a key, encrypting, or decrypting, the output is sent to STDOUT or the Terminal typically. You can easily redirect the output to a file or another program using the > operator. Refer to the usage patterns for examples. If you need to store the key or the encrypted data as an ASCII encoded string, use base64 encoding.

At some point in this example, you will see the message being split into two pieces, the IV, and the cipher text. The initialization vector, or IV, is a random value that gets prepended to the actual encrypted message. Every time a message is encrypted with AES, a random value is generated and used as ...

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.