Brainscape GPG Flashcards

1
Q

encrypt a file with symmetric encryption

A

gpg –symmetric file.txt gpg -c file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

decrypt a file

A

gpg –decrypt file.txt.gpg OR gpg -d file.txt.gpg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

specify name of output file

A

gpg –output file.txt OR gpg -o file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

ASCII-armored output

A

gpg –armor gpg -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

digitally sign and symmetrically encrypt a file

A

gpg –sign –symmetric file.txt gpg -s -c file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

assymetrically sign and encrypt a message

A

gpg –recipient “John Maughan” –sign –encrypt “file.txt” OR gpg -s -e -r “John Maughan” file.txt (specify both “–sign” and “–encrypt” options)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

assymetrically encrypt a message for multiple recipients

A

gpg –recipient “My Friend” –recipient “John Maughan” –encrypt “file.txt”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

two ways can you identify a recipient

A

key-id or name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what are the two purposes of signing, and how does this work

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

three methods of signing

A

clearsign (ASCII digital signature, appended to the message itself) sign (binary digital signature) detached (signature will be in a separate file)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

clearsign a file (like the end of an email)

A

gpg –clearsign file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

sign a file (normal, not ASCII)

A

-s –sign (e.g. “gpg –sign file.txt”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

verify a signature

A

“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”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

sign a file with a detached signature

A

gpg –detach-sign file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

verify a file with a detached signature, also, verify if file is in a separate folder

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

sign and encrypt a file to a recipient

A

gpg –sign –encrypt file.txt –recipient “John Maughan” gpg -s -e -r “John Maughan” file.txt

17
Q

decrypt and verify in one step

A

-d –decrypt (e.g. “gpg -d file.txt.gpg”) (–decrypt will automatically try to verify a digital signature, if one is present)

18
Q

what are the convention for ASCII-armored contents, binary contents, and signatures

A

.asc .gpg .sig

19
Q

create a keypair

A

gpg –gen-key

20
Q

export to get your public key to someone else

A

gpg –armor –output public_key.key –export “John Maughan”

21
Q

import a key

A

gpg –import “friend-key.asc”

22
Q

what files/folders need to be backed up for keys, how to best backup trust settings

A

pubring.gpg private-keys-v1.d gpg –export-ownertrust (preferred because it can help even if trustdb.gpg is corrupted somehow)

23
Q

export a secret key

A

gpg –export-secret-keys KEY-ID > private_key

24
Q

import a private key

A

gpg –import private_key (same as importing a public key)

25
Q

list public keys, list public keys for a specific person

A

gpg –list-keys OR gpg –list-public-keys “John Maughan” (user name or key-id)

26
Q

list secret keys, list secret keys for a specific person

A

gpg –list-secret-keys gpg –list-secret-keys “John Maughan” (or key-id, just as for public keys)

27
Q

what are a few key ways to go about verifying keys

A

get in touch over phone, read fingerprints back and forth, send an encrypted and signed email to each other with three random words, and read those back to each other

28
Q

how to set trust level for an imported key

A

gpg –edit-key “My Friend” trust (set trust level)

29
Q

check that a key is signed

A

gpg –edit-key “My Friend” check

30
Q

view fingerprint for key

A

gpg –fingerprint “John Maughan” or gpg –edit-key “My Friend” fpr (fingerprint for the key)

31
Q

sign a key

A

gpg –edit-key “My Friend” sign (sign the key)

32
Q

publish a key to a keyserver

A

gpg –keyserver KEYSERVER –send-keys KEY-ID

33
Q

generate a revocation certificate

A

gpg –gen-revoke KEY-ID (revocation certs are always armored)

34
Q

file where gpg preferences are kept

A

gpg.conf

35
Q

how to actually revoke a key

A

simply import the revocation key or upload it to the keyserver