Last active
June 26, 2019 20:02
-
-
Save chavafg/b22626a2f4554c13f033f60159930ac8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
message="message.txt" | |
encrypted_msg="message.gpg" | |
receiver_pub_key="receiver_key.pub" | |
receiver_email="[email protected]" | |
# 1. Receiver - Create public key. | |
gpg --gen-key | |
# 2. Receiver - Export public key and share it with the Sender | |
gpg --armor --output "$receiver_pub_key" --export "$receiver_email" | |
# 3. Sender - import gpg key from receiver. | |
gpg --import "$receiver_pub_key" | |
# 4. Sender - Encrypt message to be sent. | |
gpg --output "$encrypted_msg" --encrypt --recipient "$receiver_email" "$message" | |
# 5. Sender - Send encrypted message to the receiver. | |
# 6. Receiver - Decrypt the message. | |
gpg --output message --decrypt "$encrypted_msg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment