How to protect a password file

A simple way to encrypt a file with a password is to use gpg (GnuPG). Suppose we have a file mysamplefile.txt, to encrypt it type the following on console.

$ gpg -c mysamplefile.txt

You will be asked to enter a paraphrase twice
A new file named mysamplefile.txt.gpg will be created.

To decrypt the file type

$ gpg  mysamplefile.txt

Again it will ask the paraphrase and decrypt the file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s