Simple use of GPG in Linux

Source: Internet
Author: User

Simple use of GPG in Linux

This article briefly describes how to encrypt and use GPG in Linux.

1. Generate a key

Gpg-gen-key

The following screen may appear,

> This information prompts you to create random activities on the system. You can do more things at this time, such as opening another session and entering some commands at will, this gives the random number generator a better chance of obtaining enough entropy.

If it succeeds, the following screen is displayed:

Ii. View keys

View Public key: gpg -- list-key

View private key: gpg -- list-secret-keys

Iii. Key extraction:

Extract Public Key: gpg-a -- export newkey> newkey. asc

Private Key extraction: gpg-a -- export-secret-keys newkey> newkey_pirv.asc

Iv. Import key

Import public or private key: gpg -- import newkey

5. Use the public key to encrypt the file:

Gpg-ea-r newkey filename

The encrypted file filename. asc is generated.

6. Use the private key for decryption

Gpg-o filename-d filename. asc

Enter the private key password

You can decrypt the encrypted file filename. asc into a filename file.

7. delete a key

Delete Private Key

Gpg -- delete-secret-key newkey

Delete Public Key

Gpg -- delete-key newkey

OpenSUSE

Simple gpg application in Linux

The GPG author almost went bankrupt and the crisis has passed.

This article permanently updates the link address:

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.