Using GPG to encrypt and decrypt a file
78,354
Published 2018-12-12
- demo using GnuPG/GPG CLI
- GPG to encrypt and decrypt a (data) file
- Key lifecycle - Export and import keys (public and private keys)
------------------------------------------------------------------------
Install:
--------
apt-get install gnupg
List keys:
----------
gpg --list-secret-keys
gpg --list-keys
Generate keys:
-------------
gpg --full-generate-key
OR
gpg --gen-key
Export/Import keys:
-------------------
gpg --export -a Melvin > melvin_public.key
gpg --import melvin_public.key
gpg --export-secret-keys Melvin > melvin-private-key.key
gpg --import melvin-private-key.key
Encrypt & Decrypt
-----------------
gpg -e -r "Melvin" users.csv
gpg --always-trust -e -r "Melvin" users.csv
gpg -d users.csv.gpg
gpg --batch --passphrase demo users.csv.gpg
All Comments (21)
-
Great video! It goes straight to my library. I will share the link if someone asks me about the subject.
-
Thanks for the tutorial of GPG. By far it’s the best I have been able to find on the internet.
-
Thanks for clear and organized explanation for the GnuPG CLI.
-
I work with Encryption Appliance solutions but never had the need to understand Exporting/Importing keys (due to separation of duties these days) and it really just helped me understand another important component where you can separate out the Private and Public keys and Encrypt files at another source. Excellent video Melvin and great job explaining it.
-
Liked, subscribed, bookmarked. That was the BEST, clearest demo. Thank you!
-
Finally I get it. Thanks so much! Good job!
-
Thank you for such a clear step-by-step explanation. This is great content
-
OMG man you nailed it, i wasted days but this 18 min video saves me
-
Fantastic video, to the point information. Thank you for helping me understand how to use gpg :)
-
Thanks Melvin. It is a great tutorial for the gpg tutorial.
-
Certified GOAT. thx a lot <3
-
Thank you a lot for the clear explanation!
-
Great explanation. Simply superb. Thanks.
-
pretty cool ! and well explained thank you
-
thanks so much and thanks for providing the examples, copy pasted to my cheat sheet :)
-
Thank you from 1.5 years later! Exactly what I needed. Clear, concise & to the point. Thank you also for having your commands pre-typed; that saves time & we can pause as necessary.
-
Great demo, thanks!
-
Thank you very much Melvin
-
Thankyou so much Melvin 🎈⚡
-
Thanks for this video, it's very helpful.