Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

How to encrypt and decrypt a text file using openssl rsa public and private keys

openssl rsautl -encrypt -pubin -inkey public_key.pem -in secret.txt -out secret.enc
#where "secret.txt" is the original file and "secret.enc" is the encrypted file.

# To decrypt
openssl rsautl -decrypt -inkey private_key.pem -in secret.enc
 
PREVIOUS NEXT
Tagged: #How #encrypt #decrypt #text #file #openssl #rsa #public #private #keys
ADD COMMENT
Topic
Name
5+1 =