Using GPG is very simple, it is a command-line based tool that is primarily used to encrypt files 1. Generate keys you must generate a pair of keys before using GPG. [Root@tipy root]$ GPG--gen-key After this, you will be asked which encryption method to choose Das and Eigamal, Das, Eigamal. The first is the default, which includes all the attributes of the GPG. Generally we all choose it. Next it will ask you what you want KeySize, the default keysize is 1024 bits (usually used), we choose it. Of course you can choose other, like 2048 ... Depends on what you need. The next step is to set the time limit for passwords. Choose 0 if you don't need a password period. And if you need to choose something else, such as 1y refers to a year, you can also specify the number of days, weeks, months. The next step is to enter your personal information, the user ID consists of three parts: real name, annotation, and email address. Only one input is OK. The final step is to enter the password (passphrase), which is used when decrypting, must remember OH. Repeat input once over the. We can enter GPG--list-keys view our key Information 2 use GnuPG encryption after generating the key, we can start using GPG to encrypt the file. Create a text file Test.file, enter some characters, and save. [root@tipy root]$ gpg-ea-r name Test.file where name is the user name you entered when you used it to generate the key, the file encrypted with this username can only be decrypted by that user name. A TEST.FILE.ASC file is generated after the carriage return, which is the file after the encryption. The-e option tells GPG to encrypt, the-a option tells GPG to encrypt ASCII, which is appropriate for mail delivery and can be viewed. If it is not encrypted in ASCII form, it can be encrypted to binary. -r Specifies the encrypted user. The second decryption [root@tipy root]$ gpg-d test.file.asc >test.file type carriage return, will require you to enter the password, only input the key generated by the password on the line summed up: GPG use is very simple, there are many other useful performance, Interested in learning can go to see http://www.mandrakesecure.net/en/docs/gpg.php to force (0 Votes) Tempted (0 Votes) nonsense (0 Votes) Professional (0 Votes) title Party (0 Votes) passing (0 votes) Original: Use GnuPG to encrypt the file return to the Network security home page
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.