An easy way to encrypt and decrypt large files using OpenSSL and Linux:
Generate PEM public private key using openssl:
We can generate hash using md5sum for both files so we can compare them once we decrypt our file:
Decrypt large file using OpenSSL:
Check md5sum output:
#linux #openssl #pem #encryption #decryption #x509 #public_key #private_key
Generate PEM public private key using openssl:
openssl req -x509 -nodes -newkey rsa:2048 -keyout private-key.pem -out public-key.pemEncrypt file using public key PEM file:
openssl smime -encrypt -binary -aes-256-cbc -in large_file.img -out large_file.img.dat -outform DER public-key.pem
We can generate hash using md5sum for both files so we can compare them once we decrypt our file:
md5sum large_file.img*
#cd573cfaace07e7949bc0c46028904ff large_file.img
#c4d8f1e868d1176d8aa5363b0bdf8e7c large_file.img.dat
Decrypt large file using OpenSSL:
openssl smime -decrypt -in large_file.img.dat -binary -inform DEM -inkey private-key.pem -out decrypted_large_file.img
Check md5sum output:
md5sum *large_file.img*
#cd573cfaace07e7949bc0c46028904ff decrypted_large_file.img
#cd573cfaace07e7949bc0c46028904ff large_file.img
#c4d8f1e868d1176d8aa5363b0bdf8e7c large_file.img.dat
#linux #openssl #pem #encryption #decryption #x509 #public_key #private_key
https://gpgtools.tenderapp.com/kb/how-to/first-steps-where-do-i-start-where-do-i-begin-setup-gpgtools-create-a-new-key-your-first-encrypted-mail
#gpg #email #encryption #privacy
#gpg #email #encryption #privacy
Tenderapp
First steps - where do I start, where do I begin? (Setup GPGTools, Create a new key, Your first encrypted email) / Tutorials /…
GPGTools, GPG Mail, Support, Customer, Issues, Troubleshooting, Problem, GPGServices, GPG Keychain Access, GKA, MacGPG, MacGPG2, GPGPreferences, MacGPG1, Mobile OpenPGP