Showing posts with label Encrypt. Show all posts
Showing posts with label Encrypt. Show all posts

Monday, September 15, 2008

CRYPT AN ASCII FILE

An ascii file can be easily encrypted and decrypted.
To encrypt simply pipe the STDOUT ofthe file to "crypt" and redirect it toa new file name. Enter a passowrd whenprompted with "Enter key".

$ cat foo crypt > foo.e
Enter key:

To unencrypt simply pipe the STDOUT ofthe encrypted file to "crpyt" andredirect it to a new file name. Entera passowrd when prompted with"Enter key".
$ cat foo.e crypt > foo.new
Enter key:

Wednesday, July 2, 2008

Linux: How to Encrypt and decrypt files with a password

To encrypt and decrypt files with a password, use gpg command. It is an encryption and signing tool for Linux/UNIX like operating system such as FreeBSD/Solaris.


GnuPG stands for GNU Privacy Guard and is GNU's tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility.

Encrypting a file in linux
To encrypt single file, use command gpg as follows:

$ gpg -c filename


To encrypt myfinancial.info file, type the command:$ gpg -c myfinancial.info

Output:

Enter passphrase:
Repeat passphrase:


This will create a myfinancial.info.gpg file.

Option:
-c : Encrypt with symmetric cipher

Caution if you ever forgot your password aka passphrase, you cannot recover the data as it use very strong encryption.