simple gpg password protected file encryption example

Creating the file:

vi passwords.txt

Encrypt the file:

gpg -c -a passwords.txt

and enter a password when prompted, >now delete the original plain text file

rm passwords.txt

Viewing the file:

to view the file with less

gpg -d passwords.txt.asc | less

and enter the password when prompted

Editing the file:

To edit the password file decrypt the file to plain txt

gpg passwords.txt.asc

this will place a plain text file call passwords.txt in the current directory

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP, ReactJS, Tableau, AWS RedShift and Matillion ETL

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly

Leave a comment

Name Notify me of replies by email.