Brainscape GPG Flashcards
encrypt a file with symmetric encryption
gpg –symmetric file.txt gpg -c file.txt
decrypt a file
gpg –decrypt file.txt.gpg OR gpg -d file.txt.gpg
specify name of output file
gpg –output file.txt OR gpg -o file.txt
ASCII-armored output
gpg –armor gpg -a
digitally sign and symmetrically encrypt a file
gpg –sign –symmetric file.txt gpg -s -c file.txt
assymetrically sign and encrypt a message
gpg –recipient “John Maughan” –sign –encrypt “file.txt” OR gpg -s -e -r “John Maughan” file.txt (specify both “–sign” and “–encrypt” options)
assymetrically encrypt a message for multiple recipients
gpg –recipient “My Friend” –recipient “John Maughan” –encrypt “file.txt”
two ways can you identify a recipient
key-id or name
what are the two purposes of signing, and how does this work
you can prove that the message was sent from you, and prove that its content was not altered the signature uses a hash of your message as well as your private key
three methods of signing
clearsign (ASCII digital signature, appended to the message itself) sign (binary digital signature) detached (signature will be in a separate file)
clearsign a file (like the end of an email)
gpg –clearsign file.txt
sign a file (normal, not ASCII)
-s –sign (e.g. “gpg –sign file.txt”)
verify a signature
“gpg –verify file.txt.asc” (if signature is detached, you can just specify the signature; and gpg will look for the “file.txt” without the “.asc”) OR “gpg –verify sigfile signed-files”
sign a file with a detached signature
gpg –detach-sign file.txt
verify a file with a detached signature, also, verify if file is in a separate folder
gpg –verify file.txt.sig (assumes file.txt is also in the same folder) gpg –verify file.txt.sig /path/to/file.txt (if in separate folder)