GPG is a free encryption and digital signature software. It comes with Linux and can encrypt files and emails to ensure file integrity and security.
GPG is divided into private key and public key. The public key can be used to disclose the files encrypted by the private key. The files encrypted by the Public Key can also use the private key to verify the integrity.
Generate a GPG key:
Gpg -- gen-key
View keys:
Gpg -- list-key # Public key list
Gpg -- list-secret-keys # Private Key list
Export key:
Gpg -- export-a admin@onovps.com> gpg. pub # export Public Key
Gpg -- export-secret-keys-a admin@onovps.com> gpg. pri # export private key
Encrypted File: www.2cto.com
Gpg-su admin@onovps.com file # sign the file with the specified public key
Gpg-se-r onovps-u admin@onovps.com file # Use the specified public key signature to encrypt the file
Gpg-absu admin@onovps.com file # Use the specified public key to sign the file and separate the certificate
Decrypt the file:
Gpg-d file
If a digital signature is used, file integrity can be verified:
Gpg -- verify file. asc
Note: The difference between signature and encryption is that digital signatures are used for data integrity and data confidentiality. Encryption and signature can be performed simultaneously.