1. GPG (GNUprivacyguard) can use the GPG command under UbuntuLinux to encrypt and decrypt files. Basically, each release of GPG is pre-installed. If you want to encrypt the file named secret.txt: #gpg-csecret.txt, the pop-up dialog box will pop up automatically asking for the encryption password: After two input passwords are confirmed, secret.txt. gpg will be generated under the directory. This is the encrypted file. Do not
1. GPG (GNU privacy guard)
In Ubuntu Linux, you can use the GPG command to encrypt and decrypt files. Basically, each release of GPG is pre-installed.
Assume that the file name you want to encrypt is secret.txt:
# Gpg-c secret.txt
The pop-up dialog box will pop up asking for the encrypted password:
After two passwords are entered, secret.txt. gpg is generated in the directory. This is the encrypted file. Do not forget to delete the original file ~
Decryption:
# Gpg secret.txt. gpg
Input the secret password, and secret.txt will be generated again in the current directory.
Sometimes we need to add a signature when installing the software and download an encrypted file, such as the steps for installing wine:
1. Add the latest wine source for Ubuntu gutsy:
Wget-q http://wine.budgetdedicated.com/apt/387EE263.gpg-O-| sudo apt-key add-
2. Obtain the apt list of Wine for Gutsy.
Sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/gutsy.list-O/etc/apt/sources. list. d/winehq. list
3. update and upgrade references:
Sudo apt-get update
Sudo apt-get dist-upgrade
4. Install wine
Sudo apt-get install wine
Ii. apt-key command:
Apt-key is the security management tool of the Debian software package. Each released deb package passes key authentication, and apt-key is used to manage the key.
Apt-key list
Lists keys saved in the system.
Apt-key add keyname
Add the downloaded key to the local trusted database.
Apt-key del keyname
Delete keys from the local trusted database.
Apt-key update
Update the local trusted database and delete expired keys that are useless.