GPG stands for Gnu Privacy Guard, is a tool used to sign and encrypt data. Here I'm giving a simple usage of this tool.
Usecase: We have a file on linux server, which needs to be encrypted and delivered to another machine.
Solution:
- By default every linux server comes with "gpg" tool. You can verify by running the command "which gpg"
- Use gpg command to encrypt your file
gpg -c CONARY (It will ask for the passphrase/password, give a strong one and remember it)
It creates a file named CONARY.gpg, which is encrypted. You can take a look at the content of this file
- Using gpg command for decryption
gpg -o CONARY -d CONARY.gpg
Where -o option tells to create a file CONARY, instead of printing output on console
Strengthening encryption using AES256 cipher algo
Command to Encrypt
gpg --symmetric --cipher-algo aes256 -o dpm-3.2-src.tar.gz.gpg dpm-3.2-src.tar.gz
Enter passphrase: *******
Command to decrypt
gpg -d -o dpm-3.2-src.tar.gz dpm-3.2-src.tar.gz.gpg
gpg: AES256 encrypted data
Enter passphrase: *******
Strengthening encryption using AES256 cipher algo
Command to Encrypt
gpg --symmetric --cipher-algo aes256 -o dpm-3.2-src.tar.gz.gpg dpm-3.2-src.tar.gz
Enter passphrase: *******
Repeat passphrase: *******
Command to decrypt
gpg -d -o dpm-3.2-src.tar.gz dpm-3.2-src.tar.gz.gpg
gpg: AES256 encrypted data
Enter passphrase: *******
1 comment:
This blog is nice and very informative. I like this blog. blogPlease keep it up.
Post a Comment