In: Computer Science
Using OpenSSL from the command line interface. Please solve all the following questions. I also need the screenshots for every part.
a. Create a text file with some input and encrypt it using
i. AES-128 CBC
ii. AES-256 CTR
iii. DES
b. Create a 2048 bit RSA public and private key
OpenSSL is cryptography toolkit which can be used for encryption and decryption of files and messages.
Now let's move to the question:-
A)Assume that you have created a file named "ashok.txt" with some personal input and you want to encrypt it.
i) Encrytion with AES-128 CBC:-
Open the command line interface of your pc which may have windows or linux and type there:-
Note: You can download OpenSSL from their official website and install in your system incase there is no OpenSSL but most of the linux distro have already pre-installed OpenSSL.
i) openssl enc -aes-128-cbc -salt -in ashok.txt -out ashok.txt.enc
ii) Encrytion with AES-256 CTR:
openssl enc -aes-256-ctr -salt -in ashok.txt -out ashok.txt.enc
iii)DES:-
Decryption of both AES-128 CBC and AES-256 CTR:- Same file will be decrypted:
AES-128 CBC DES:-
openssl enc -aes-128-cbc -d -in ashok.txt.enc -out ashok.txt
AES-256 CTR DES:-
openssl enc -aes-256-ctr -d -in ashok.txt.enc -out ashok.txt
syntax Explanation:-
openssl= cmd line tool
enc= encryption with ciphercodes
aes-256-ctr and aes-128-cbc= Encryption methods
salt= makes more powerful encryption
in= input data or file
ashok.txt= original file(without encrypted)
ashok.txt.enc= Encrypted file
out= output file
d= Decrypts data
B)Create a 2048 bit RSA public and private key:-
2048 bit RSA public key generation:-
command:- openssl genrsa -des3 -out public.pem 2048
2048 bit RSA private key generation:-
command:- openssl genrsa -des3 -out private.pem 2048
Please consider a thumbs-up(like),it really helps to be motivated.>3
#TIA