Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
becki:linux:openpgp [2015-04-20 12:59] becki created |
becki:linux:openpgp [2015-05-27 15:26] (aktuell) becki |
||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== OpenPGP == | ====== OpenPGP == | ||
| + | ===== Abstract == | ||
| - | Abstract: The sender encrypts a file with the public key of the receiver. After sending the receiver decrypts the file with his secret key. Digital Signatures are also possible. Infos from ''man pgp'' or [[http://www.gnupg.org/gph/en/manual.html|Manual]] | + | The sender encrypts a file with the public key of the receiver. After sending the receiver decrypts the file with his secret key. Digital Signatures are also possible. Infos from ''man pgp'' or [[http://www.gnupg.org/gph/en/manual.html|Manual]] |
| - | **Create** a new primary keypair and ''%%~/.gnupg%%'' with ''%%gpg --gen-key%%''. Keep all default values. Specifiy given name, surname, and email adress. Comment can be omitted. | + | ===== Commands == |
| + | ==== Create / delete Keys == | ||
| + | |||
| + | **Create** a new primary keypair (in ''%%~/.gnupg%%'') with ''%%gpg --gen-key%%''. Keep all default values. Specifiy given name, surname, and email adress. Comment can be omitted. | ||
| Create a [[http://www.gnupg.org/gph/en/manual.html#REVOCATION|revocation certificate]] with ''%%gpg --output revoke.asc --gen-revoke <mykey>%%'' to declare your public key invalid in case the private key gets lost or exposed. ''mykey'' must be a substring of the user ID which you specified at keypair cration. Copy it eg to a floppy disk and lock it. | Create a [[http://www.gnupg.org/gph/en/manual.html#REVOCATION|revocation certificate]] with ''%%gpg --output revoke.asc --gen-revoke <mykey>%%'' to declare your public key invalid in case the private key gets lost or exposed. ''mykey'' must be a substring of the user ID which you specified at keypair cration. Copy it eg to a floppy disk and lock it. | ||
| - | Optionally **list** your key(s) with ''%%gpg --list-keys%%'' | + | Delete a key |
| + | gpg --delete Harry | ||
| - | **Export** a public key (create a texfile of your public key) with ''%%gpg --armor --export <mykey> > myFullName.asc%%'' | + | ==== List Keys == |
| - | **Import** a foreign public key by issuing ''%%pgp --import harryHirsch.asc%%''. Check with ''%%gpg --list-keys%%''. | + | List public keys |
| + | gpg -k | ||
| + | |||
| + | List secret keys | ||
| + | gpg -K | ||
| - | **Validate** the key with ''%%gpg --edit-key Harry%%'' -> ''fpr'' -> Compare fingerprint by word of mouth -> ''sign'' -> ''check'' -> ''quit'' -> save:y | + | ==== Export / import Keys == |
| - | **Encryption** of a file is done by ''%%gpg --encrypt file%%'' and **decrpytion** by ''%%gpg --decrypt file.gpg > file%%'' | + | Export a public key (create a texfile of your public key). Preferably use the full id of the primary key (see list keys) as unambiguous identifier. |
| + | gpg --armor --export <id> > myFullName.asc | ||
| - | **Delete** a key with ''%%gpg --delete Harry%%'' | + | Export a private key: ([[http://stackoverflow.com/questions/5587513|source]]) |
| + | This seems to include the public key as well. Importing such a key also imports its corresponding public key. (tested) | ||
| + | gpg --export-secret-keys <id> > key.asc | ||
| + | |||
| + | Import a foreign key: | ||
| + | ggp --import harryHirsch.asc | ||
| + | |||
| + | An imported key needs to be validated(?). Validate the key with: | ||
| + | gpg --edit-key Harry -> fpr -> (Compare fingerprint by word of mouth) -> sign -> check -> quit -> save:y | ||
| + | |||
| + | ==== Encrypt / decrypt files == | ||
| + | |||
| + | Encryption of a file | ||
| + | gpg --encrypt file | ||
| + | |||
| + | decrpytion | ||
| + | gpg --decrypt file.gpg > file | ||
| + | |||
| + | ===== Other == | ||
| ''kgpg'' is a graphical frontent on slackware. | ''kgpg'' is a graphical frontent on slackware. | ||
| + | |||
| + | Did not see any difference between gpg and gpg2 so far. => Use gpg, cause ist easier to type. | ||