GnuPG:
GnuPG stands for GNU Privacy Guard. GnuPG is an open implementation of OpenPGP ( Pretty Good Privacy ) standard as defined in RFC 4880. it 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.
Using GnuPG gpg command you can generate public and private keys. To encrypt and decrypt files with a password, use gpg command.
How to check Gnu PG Package On Linux:
Most Linux distributions today include GnuPG by default. To find out if this is the case, open a command prompt and type
#gpg --version
If output is GnuPG x.y.z or some later version, then GnuPG package already installed.
How to install GnuPG on Linux:
use the following command to install GnuPg tool.
#yum install gnupg
Encrypting a file in linux:
To encrypt a single file, use command gpg as follows:
#gpg -c filename
For example:
To encrypt anshuamn.txt file, type the command:
#gpg -c anshuman.txt
Enter passphrase:<Password For Encrypt the File>
Repeat passphrase:<Password For Encrypt The File>
if you ever forgot your password (passphrase), you cannot recover the data as it use very strong encryption.
Decrypt a file in linux:
To decrypt file use the gpg command as follow:
#gpg <encrypt file name>
For example:
To decrypt anshuamn.txt.gpg file, type the command:
#gpg -c anshuman.txt.gpg
gpg anshuman.txt.gpg
gpg: CAST5 encrypted data
Enter passphrase:<enter encrypt password for decrypt the file>
Decrypt file and write output to file linux.txt you can run command:
#gpg anshuman.gpg –o linux.txt
No comments:
Post a Comment