File Security using Advance Encryption Standards (AES) Keys and Initialization Vector (iv).
This article is all about encryption decryption of a file using AES Keys plus Initialization Vector.
Remember AES is a symmetric key Algorithm.
After Reading this article you will be able to Understand:
1.How to Encode Decode a File with the Generated Key pair.
2.How to generate KEY PAIR (AES+IV)
3.How to Encrypt a file using AES generated key pair.
4.How to Decrypt a File using AES generated key pair.
Let’s start performing this lab using an example lab.
Then Generate a Key PAIR of AES+IV using Openssl
#openssl enc -nosalt -aes-256-cbc -k hello-aes -P Remember: in above command hello-aes is important and is like password. if you type anything in place of hello the key and iv value will changed.
Creating a File named a.txt using echo.
#echo "satish tiwary"> a.txt
Then Encoding a.txt File using Generated Key and IV
#openssl enc -nosalt -aes-256-cbc -in a.txt -out a.txt.enc -base64 -K <key> <iv>
Decoding of File using Generated Key and IV
#openssl enc -nosalt -aes-256-cbc -d -in a.txt.enc -out a.txt -base64 -K <key> <iv>
Nice post, sir.
LikeLike