Tuesday, May 31, 2016

GPG cheatsheet

Getting Started

Creating your secret key will start with:
gpg --gen-key
You should probably use the default settings, except it doesn't hurt to make the key size as large as allowed (4096 bits currently.) The larger the key size, the longer it will take to initially generate your key (and encryption/decryption will be slightly slower. That is a Good Thing, as anyone attempting to break your encryption will also need to spend more time too.)
to export a public key into file public.key:
gpg --export -a "User Name" > public.key
list your key : 

gpg --list-keys your@email.address
to export a public key into file public.key :
gpg --export -a "User Name" > public.key
to export a private key :
gpg --export-secret-key -a "User Name" > private.key
To encrypt data, use :
gpg -e -u "Sender User Name" -r "Receiver User Name" somefile
gpg -s -a -r "User Name" -e somefile # the output file ""somefile.asc""
gpg --encrypt somefile # the output file ""somefile.gpg""
To decrypt data, use :
gpg -d somefile.gpg

No comments:

Post a Comment