retprogramisto avatar

How to use symmetric (password) encryption with GPG

retprogramisto

Published: 10 Nov 2018 › Updated: 10 Nov 2018How to use symmetric (password) encryption with GPG

How to use symmetric (password) encryption with GPG

Many people already know how to use GPG/PGP to encrypt emails, messages and files with asymmetric public key encryption.

However there are times when symmetric (password) encryption may be a better option.

For this you can use gpg --symmetric option. GPG includes the AES256 algorithm which is considered to be secure, as long as you set a secure password.

The encryption command is:
gpg -a --symmetric --cipher-algo AES256 my_file.txt

(-a option encodes your encrypted file with ASCII armor so that it is easy to copy into a message or send as an attachment. These files have the file ending .asc)

Enter the command, choose a password and your encrypted file will be saved to my_file.txt.asc.

You can encrypt any files with this method, e.g. .txt, .doc, .zip.

To decrypt the file, enter:
gpg -a --output decrypted_file.txt --decrypt my_file.txt.asc
Then enter the password and your decrypted file will be saved to decrypted_file.txt


If you found this guide useful, feel free to send a contribution to 1CaLCR5mGwS4FJzU1HZm9qwr5WoRYFDdyB (BTC).


This article was written by Web4Crypto. Web4Crypto offers web development, web design, programming and scripting services from $40 and accepts Bitcoin, Monero, Ethereum and other cryptos. Visit https://web4crypto.xyz for more information and a free consultation.

Leave How to use symmetric (password) encryption with GPG to:

Written by

Web programmer, crypto enthusiast

Read more #privacy posts


Best Posts From retprogramisto

We have not curated any of retprogramisto's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From retprogramisto