Last active
March 13, 2019 15:41
-
-
Save arnauldvm/45d37f54036230e4951827b4a649e4b0 to your computer and use it in GitHub Desktop.
Symmetric encryption using openssl
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
openssl rand 16 | base64 > temp_key | |
echo "Data to be encrypted" | openssl aes-256-cbc -pass file:temp_key > data.encrypted | |
# Send the file "data.encrypted" | |
# Send the temp_key (if possible, encrypted with the public key of the recipient) | |
# Recipient side: | |
openssl aes-256-cbc -d -in data.encrypted -pass file:temp_key | |
# See also: https://bjornjohansen.no/encrypt-file-using-ssh-key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment