GPG Encryption Decryption
How does this work?
- [x] generate SECRET_KEY to encrypt files
- [x] share this SECRET_KEY to decrypter machine
- [x] import this SECRET_KEY on encrypter machine
- [x] encrypt file using this SECRET_KEY
- [x] send this encrypted file to the decrypter machine
- [x] decrypt the file using the SECRET_KEY on decrypter machine
Decrypter Machine
- [x] generate gpg key using this command
gpg --gen-key
or use this command
gpg --full-gen-key
- [x] list out your keys using this command
gpg --list-keys
- [x] export your key using this command (to send to encrypter)
gpg --export -a YOUR_KEY_ID > YOUR_FILE_NAME.asc
This will generate a file. You can share this file to the Encrypter Machine. They'll import this key and encrypt the file using this key which you can later on decrypt on your machine.
Encrypter Machine
- [x] import the SECRET_KEY of the decrypter
gpg --import YOUR_SECRET_KEY_FILE_NAME.asc
- [x] list out your keys using this command
gpg --list-keys
- [x] encrypt the pgp file
gpg --encrypt --recipient SECRET_KEY_ID --output ENCRYPTED_FILE FILE_TO_ENCRYPT
share this encrypted file to your decrypter machine
Decrypter Machine
- [x] decrypt the file
gpg --decrypt --recipient SECRET_KEY_ID --passphrase YOUR_PASSWORD --output DECRYPTED_FILE ENCRYPTED_FILE
yippie banzai we did it!
Top comments (0)