Generate keysopenssl genrsa -out key.pemopenssl rsa -in key.pem -out key.pub -pubout# Encrypt and Decrypt a file (using public key to encrypt)echo --pass-- > pass.txtopenssl rsautl -in pass.txt -out pass.enc -pubin -inkey key.pub -encryptopenssl rsautl -in pass.enc -out pass.dec -inkey key.pem -decryptcat pass.dec# Compress, Encrypt, Decyrpt, Uncompress a file (using password in pass.txt)echo content > file.txtgzip file.txtopenssl bf -in file.txt.gz -out file.enc -pass file:pass.txt -eopenssl bf -in file.enc -out file.dec.gz -pass file:pass.dec -dgzip -d file.dec.gzcat file.dec
Search This Blog
Friday, February 7, 2020
Encrypt decrypt via public key
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment