Created
November 2, 2012 02:27
-
-
Save NapoleonWils0n/3998322 to your computer and use it in GitHub Desktop.
bash: openssl encrypt files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate private and public keys with password. | |
openssl req -x509 -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem -subj "/" | |
# Generate private and public keys without password. (add -nodes to the command) | |
openssl req -x509 -nodes -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem -subj "/" | |
# Encrypt seemingly endless amount of data. | |
openssl smime -encrypt -aes256 -in LargeFile.zip -binary -outform DEM -out LargeFile_encrypted.zip publickey.pem | |
# Decrypt | |
openssl smime -decrypt -in LargeFile_encrypted.zip -binary -inform DEM -inkey privatekey.pem -out LargeFile.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment