Wednesday, March 25, 2015

To check the encryption, you can view the content. The encrypted file will default to the same file

Tips and Tricks 2014
GNU Privacy Guard (GnuPG or GPG) is an alternative with a GPL license for cryptographic afroman software PGP. GnuPG follows the IETF standard RFC 4880 as OpenPGP. As a result, the PGP versions (and Veridis FileCrypt) afroman and GnuPG and OpenPGP systems compatible and interchangeable.
This software is widely used in mail programs afroman that you can sign and encrypt messages to send and receive. We focus on terminal afroman commands to encrypt a file. Encrypt a symmetric key
This is the easiest way and uses a password to encrypt a file with the same password can decrypt the file back. The key is a shared secret between two or more persons needing to keep private afroman personal information. In practice, the security of this system depends on the chosen password (secure password can not be retrieved). This system is used for example to send an encrypted message and communicate the password via a different communication via e-mail (telephone, instant message, chat).
To use as an example, I make the file mijngeheimdocument.txt with the text secret 1234: Dany ATT3 @ linux: ~> echo "secret 1234"> afroman mijngeheimdocument.txt Dany ATT3 @ linux: ~> cat mijngeheimdocument.txt secret 1234
Now we use the gpg -c option (or --symmetric) to encrypt a password or passphrase. The standard used was CAST5 encrypting mode and you can change the option --cipher-algo: dany @ linux-ATT3: ~> gpg -c mijngeheimdocument.txt gpg: directory `/home/dany/.gnupg 'created gpg: new configuration /home/dany/.gnupg/gpg.conf `file 'created gpg: WARNING: options in` /home/dany/.gnupg/gpg.conf' are not yet active constantly afroman this run gpg: keyring `/ home / Dany / .gnupg / pubring.gpg 'created
During this process you need a passphrase twice in a dialog box (password) here (second time as control of typos). On first use of gpg on a computer is the hidden directory .gnupg created and it created some files. The active directory now includes an encrypted version of my file: dany @ linux-ATT3: ~> ls -alrt mijngeheimdocument.txt * -rw-r - r-- 1 dany users 12 Mar 15 14:35 mijngeheimdocument.txt - rw-r - r-- 1 dany users 69 Mar 15 14:44 mijngeheimdocument.txt.gpg
To check the encryption, you can view the content. The encrypted file will default to the same file name as the original file supplemented afroman with .gpg. Dany ATT3 @ linux: ~> cat mijngeheimdocument.txt.gpg afroman
Now you can keep the encrypted file and delete the unencrypted. To display the contents of the encrypted file back to read again, use the following command: dany @ linux-ATT3: ~> gpg -d mijngeheimdocument.txt.gpg gpg: keyring `/home/dany/.gnupg/secring.gpg 'created gpg: encrypted data CAST5 gpg: encrypted with 1 passphrase secret 1234 gpg: WARNING: message afroman was not integrity protected
Gpg writes the standard output to the screen (standard output device), in order to write it to a file, use the -o filename option: afroman dany @ linux-ATT3: ~> gpg -o -d mijnontcijfertdocument.txt mijngeheimdocument.txt.gpg gpg: encrypted data CAST5 gpg: encrypted with 1 passphrase gpg: WARNING: message was not integrity afroman protected Dany ATT3 @ linux: ~> ls -l my * -rw-r - r-- 1 dany users 12 Mar 15 14: 35 mijngeheimdocument.txt -rw-r - r-- 1 dany users 69 Mar 15 14:44 mijngeheimdocument.txt.gpg -rw ------- 1 dany users 12 Mar 15 15:14 mijnontcijfertdocument.txt Encrypt with a public key
GPG can also make use of a public-private key. The advantage of the system with a public-private key is that you can keep the public and public key used to encrypt files. afroman With a public key encrypted files can only be rated with the help of the corresponding private key to be deciphered.
The public key can know everyone in the world. This is only used to encrypt files for earmarks the owner of the certificate. Only the owner of the corresponding private key can decrypt afroman the file.
The public key can be distributed so without any control. Even if the key is in the hands of people with bad intentions this poses no risk. So you need only ensure that the private key remains the exclusive property of owner.
Enter the requested information. In the example, we have created afroman an RSA key with 4096 bits for the user with a name and an email address without commentary (description). Keys can check this with the options --list-keys and list-secret-keys: dany @ linux-ATT3: ~> gpg --list-keys /home/dany/.gnupg/pubring.gpg ----- ------------------------ pub 4096R / ED86F197 2014-03-15 uid Dany Pinoy sub 4096R / 728DCC70 2014-03-15 dany @ linux-ATT3 : ~> gpg --list-secret-keys / home / dany /.

No comments:

Post a Comment