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: