CIW Experiment Tutorial: Encrypt with GnuPG tools under Linux

Source: Internet
Author: User
Keywords Linux
1. First we want to see if the current Linux system has GNUPG software, for Red Hat linux7.0 version will automatically install the software, we enter the following command to see if the machine is installed Linux$rpm-qa│grep GnuPG Gnupg-1.0.4-11 from above can be seen that the package has been installed, if not installed, please follow the instructor's instructions to install 2. After installing the GNUPG package, what we need to do is generate a pair of keys Linus$/usr/bin/gpg-gen-key GPG (GnuPG) 1.0.4; Copyright (C) Software foundation,inc. This program comes Sith absolutely NO WARRANTY. This are free Software,and your are welcome to redistribute it under certain. The file COPYING for details. Gpg:Warning:using insecure memory! Gpg:/home/zhuxg/.gnupg/secring.gpg:keyring created gpg:/home/zhuxg/.gnupg/pubring.gpg:kdyring created please select What kind of key you: (1) DSA and E1gamal (default) (2) DSA (Sign only) (4) E1gamal (Sign and encrypt) Your selection? 3. We enter 1 and then return (choose to use DSA and ElGamal algorithm) DSA KeyPair sill have 1024 bits. About to generate a new elg-e keypair. Minimum keysize is 768 bits default KeySize are 1024 bits highest suggested keysize is 2048 bits What keysize does you want? ( 1024) 4. Enter 2048 and then enter (select the number of digits of the key length) please specify how LOng The key should be valid. 0=key does not expire =key expires in N-th w=key expires in N-weeks M=key expires in n months-Y=key expires in n Perton K EY is valid for? (0) 5. Enter 0 return car (0 means the key never expires), and then enter Y to continue 6. Require the input Rdal name, as well as email address and passphrase 7. You can think of passphrase as the password to protect the private key, input: ciwcertified; We need to tap the keyboard arbitrarily, the program will randomly generate a pair of keys, in the user's host directory of the. GnuPG Directory 8. We can view the private key we just established linux$ Gpg-list-secret-keys view our public key linux$ Gpg-list-keys 9. Install GPG on another machine in the same way and use the following command to export the public key linus$ GPG-EXPORT>MACHINE2.ASC the name of the public key must be extended with ASC to upload this file to your machine 10. Use the following command on your machine to import the other's public key into linux$ Gpg-import Machine2.asc and again with the Gpg-list-keys command to see if you successfully imported the other's public key 11. The next thing we do is to sign the newly imported public key linux$ Gpg-sign-key machine2 Note: Here Machine2 should be the real name of the other person that created the key. We can use Pgp-list-sigs to see if we've signed the other public key correctly. Use the same method to export your public key to the other's machine 12. This allows us to encrypt the file using the other's public key, first creating a file linux$ Eacho this is a test. >encryptfile 13. Encrypt this file with the other's public key linux$ Gpg-encypt-r Receiver_pu Blic_keyname EncryptFile Receiver_public_keyname Here should be the recipient's public key name; after execution, the encrypted file will be generated ENCRYPTFILE.GPG, we cat ENCRYPTFILE.GPG output results, see how! 14. Upload this encrypted file to the other machine,The receiver uses the command to decrypt the Gpg–decrypt encryptfile.gpg after the correct passphrase is entered, the decrypted EncryptFile file is generated. 15. If you need to send a message that is both encrypted and signed, use the following command. Gpg–se–r receiver_public_keyname filename 16. Recipient received such a letter, simply input: gpg–d filename.gpg to force (0 Votes) Tempted (0 Votes) nonsense (0 Votes) Professional (0 Votes) title Party (0 votes) passing by ( 0 Votes) Original: CIW experiment Tutorial: Using GNUPG tool to realize encrypted return column home

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.