Wrapper around 7z & openssl with public key encryption and private key decryption of stored data.
-
openssl
-
7z
e7z -k pub.pem a archive.7z [input_folder|input_file]- Create a random password
- Encrypt a password with pub.pem then store in archivePassword.ssl
- Archive archivePassword.ssl to archive.7z
- Archive input_folder or input_file to archive.7z with a password
e7z -k key.pem x archive.7z- Extract archivePassword.ssl from archive.7z
- Decrypt archivePassword.ssl with key.pem to get a password
- Extract archive.7z with a password to get input_folder or input_file
- Generate RSA key in key.pem file:
openssl genrsa -out key.pem 1024
openssl rsa -in key.pem -text -noout - Save public key in pub.pem file:
openssl rsa -in key.pem -pubout -out pub.pem
openssl rsa -in pub.pem -pubin -text -noout