File Security using Advance Encryption Standards (AES) Keys and Initialization Vector (iv)

Posted: 14 Mar 2020 in cryptography, Uncategorized
Tags: , ,

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>

Verify the File after Decoding

Comments
  1. RD Saini says:

    Nice post, sir.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.