Gpg: Difference between revisions

From Wiki :-)
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable"
{| class="wikitable"
!
!
!
!Command
!
!
|-
|-
|Import public keys<ref>https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/s1-gnupg-import.html</ref>
|Import public keys<ref>https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/s1-gnupg-import.html</ref>
|<code>$ gpg --import keys.txt</code>
|<code>$ gpg --import keys.txt</code>
|
|
|-
|-
|Check the file's signature<ref>https://www.gnupg.org/download/integrity_check.html</ref>
|Check the file's signature<ref>https://www.gnupg.org/download/integrity_check.html</ref>
|<code>$ gpg --verify foo.sig foo</code>
|<code>$ gpg --verify foo.sig foo</code>
|
|-
|
|Search public key
|gpg --keyserver hkp://pgp.mit.edu --search-keys "Toto"
|-
|-
|
|
|gpg --card-status
|gpg --card-status
|
|
|-
|-
|Delete keys
|Delete keys
|gpg --delete-keys
|gpg --delete-keys
|
|
|-
|-
|Delete secret keys
|Delete secret keys
|gpg --delete-secret-keys
|gpg --delete-secret-keys
|
|
|-
|-
|List key
|List key
|gpg --list-keys
|gpg --list-keys
|
|
|-
|-
|List secret-keys
|List secret-keys
|gpg --list-secret-keys
|gpg --list-secret-keys
|
|
|-
|-
|Create master key
|Create master key
|gpg2 --full-gen-key
|gpg2 --full-gen-key
|
|
|-
|-
|Create subkey
|Create subkey
|gpg --edit-key <e-mail>
|gpg --edit-key <e-mail>
|
|-
|
|Public part of the key
|gpg -k <key-fingerprint>
|-
|Private part of the key
|gpg -K <key-fingerprint>
|}
|}


Line 59: Line 47:


https://wiki.debian.org/Subkeys
https://wiki.debian.org/Subkeys
<nowiki>:</nowiki>


gpg2 --expert --card-edit
gpg2 --expert --card-edit
Line 68: Line 54:
sudo cryptsetup --verbose --key-file - --cipher aes-xts-plain64 --key-size 512 --hash sha512 luksOpen keys.ext4.luks gpg_vault
sudo cryptsetup --verbose --key-file - --cipher aes-xts-plain64 --key-size 512 --hash sha512 luksOpen keys.ext4.luks gpg_vault


Remove private master key:
=== Remove private master key ===
 
gpg2 --with-keygrip --list-key 0x<MASTERKEY>
gpg2 --with-keygrip --list-key 0x<MASTERKEY>


Line 89: Line 74:
|
|
|https://spin.atomicobject.com/2013/11/24/secure-gpg-keys-guide/
|https://spin.atomicobject.com/2013/11/24/secure-gpg-keys-guide/
|-
|
|https://help.ubuntu.com/community/GnuPrivacyGuardHowto
|-
|
|https://www.paulfurley.com/extend-pgp-key-expiry-with-gpg/
|-
|
|https://github.com/drduh/YubiKey-Guide#install---linux
|-
|
|https://rzetterberg.github.io/yubikey-gpg-nixos.html
|}
|}


== References ==
== References ==

Latest revision as of 00:03, 29 May 2018

Command
Import public keys[1] $ gpg --import keys.txt
Check the file's signature[2] $ gpg --verify foo.sig foo
Search public key gpg --keyserver hkp://pgp.mit.edu --search-keys "Toto"
gpg --card-status
Delete keys gpg --delete-keys
Delete secret keys gpg --delete-secret-keys
List key gpg --list-keys
List secret-keys gpg --list-secret-keys
Create master key gpg2 --full-gen-key
Create subkey gpg --edit-key <e-mail>
Public part of the key gpg -k <key-fingerprint>
Private part of the key gpg -K <key-fingerprint>

opensc-tool --list-readers

pcsc_scan

ykinfo -a

https://wiki.debian.org/Subkeys

gpg2 --expert --card-edit

cryptsetup --verbose --key-file - --cipher aes-xts-plain64 --key-size 512 --hash sha512 luksFormat keys.ext4.luks

sudo cryptsetup --verbose --key-file - --cipher aes-xts-plain64 --key-size 512 --hash sha512 luksOpen keys.ext4.luks gpg_vault

Remove private master key

gpg2 --with-keygrip --list-key 0x<MASTERKEY>

rm -rf $GNUPGHOME/private-keys-v1.d/<KEYGRIPID>.key

all private keys are in private-keys-v1.d/.

Resources

https://riseup.net/en/security/message-security/openpgp/best-practices#how-to-use-this-guide
http://ekaia.org/blog/2009/05/10/creating-new-gpgkey/
https://spin.atomicobject.com/2013/11/24/secure-gpg-keys-guide/
https://help.ubuntu.com/community/GnuPrivacyGuardHowto
https://www.paulfurley.com/extend-pgp-key-expiry-with-gpg/
https://github.com/drduh/YubiKey-Guide#install---linux
https://rzetterberg.github.io/yubikey-gpg-nixos.html

References