Anda di halaman 1dari 18

GPG encryption & signing

David Morgan

David Morgan 2006-2013

Functional purposes of cryptograhy




Confidentiality
ensuring illegibility to outsiders

Authentication
ensuring ostensible and actual sender are one
and the same

Data integrity
ensuring non-alteration in transit

David Morgan 2006-2013

GPG GNU Privacy Guard




An implementation of OpenPGP

Open-PGP software uses a combination of strong public-key


and symmetric cryptography to provide security services for
electronic communications and data storage. These services
include confidentiality, key management, authentication, and
digital signatures.
Abstract, OpenPGP RFC4880

David Morgan 2006-2013

Cryptographic processing
Encryption

Decryption

(data sender)

(data receiver)

plaintext

cryptogram

cipher

reverse cipher

cryptogram

plaintext

David Morgan 2006-2013

Cryptographic strength


Difficulty of recovering plaintext from ciphertext


without the key

Does not depend on the cipher (algorithm)


standard algorithms are published

So everything depends on the key


key loss/compromise/interception=Achilles heel

David Morgan 2006-2013

Key distribution management




Good: protect it

Better: dont distribute it

David Morgan 2006-2013

Best key distribution philosophy




DONT

What good would it do after all to develop


impenetrable cryptosystems, if their users
were forced to share their keys with a Key
Distribution Center that could be
compromised by either burglary or
subpoena?
Whitfield Diffie


David Morgan 2006-2013

2 broad categories


Secret-key cryptography
versus

Public-key cryptography w!
e )

n ( 1970

David Morgan 2006-2013

Known synonymously as:




One technology

single-key
private-key
symmetric
secret-key
shared-key
conventional

Versus the other


dual-key
public-key
asymmetric

David Morgan 2006-2013

Decrypt-key distribution demands




Secret-key
distribute but protect
low risk

goo

Public-key
none, you dont need to distribute it
no risk

er!
t
t
be

David Morgan 2006-2013

Keys: secret-key crypto


Encryption

Decryption

(data sender)

(data receiver)

plaintext

cryptogram

cipher

reverse cipher

cryptogram

plaintext

(same key)

David Morgan 2006-2013

Keys: public-key crypto


Encryption

Decryption

plaintext

cryptogram

cipher

reverse cipher

cryptogram

plaintext

(different
key)

David Morgan 2006-2013

Wait a minute


who sends the key(s) to whom?

what/which key(s) does he send?

David Morgan 2006-2013

Secret-key crypto: data sender is key sender


Key sender
Encryption

Decryption

(data sender)

(data receiver)

plaintext

cryptogram

cipher

reverse cipher

cryptogram

plaintext

(same key)

Key sent
David Morgan 2006-2013

What if its public-key? more guys/keys




if there are 2 guys, there are 2 key pairs (4 keys)

who sends the key?

what key does he send?

what does that accomplish?

David Morgan 2006-2013

Well


only public keys can be sent!

so either guy could be the key sender

and he would send his public key (only! ever!)

sepending who sends, accomplishes




confidentiality, or

authentication
David Morgan 2006-2013

Data receiver as key sender


Encryption

Decryption

(data sender)

(data receiver)

plaintext

cryptogram

cipher

inverse cipher

cryptogram

plaintext

Key sender

(data receivers
private key)

Key sent
(data receivers public key)

David Morgan 2006-2013

Functional achievement checklist


Data receiver as key sender


Confidentiality

Authentication

Data integrity

David Morgan 2006-2013

Data sender as key sender


Key sender

(data
senders
private key)

Encryption

Decryption

(data sender)

(data receiver)

plaintext

cryptogram

cipher

inverse cipher

cryptogram

plaintext
Key sent
(data senders public key)

David Morgan 2006-2013

Functional achievement checklist


Data sender as key sender


Confidentiality

Authentication

Data integrity

David Morgan 2006-2013

10

But cant we have both together?




Confidentiality

Authentication

Data integrity

Certainly! if you just encrypt and decrypt twice


David Morgan 2006-2013

Encrypting the whole message


twice is too expensive!!
Make a little token1 from a big message with
a hash function2

Encrypt the token instead of the message

1also
2also

called a message digest or hash


called a digest function, like MD5 or SHA1 or RIPEMD-160
David Morgan 2006-2013

11

Confidential and authentic*


Encryption

Decryption

(data sender)

(data receiver)

*gpg

encrypt and sign

H
senders private

cryptogram

plaintext

reverse cipher
receivers public

receivers private

cipher
plaintext

S
senders public

cryptogram
H

H - hash
S - signature

OK if same
David Morgan 2006-2013

authentic but not confidential*


Encryption

Decryption

(data sender)

(data receiver)

plaintext

*gpg

senders private

plaintext

sign only,

also useful

senders public

OK if same

H - hash
S - signature

David Morgan 2006-2013

12

gpg default directories and files


/

home

tom

harry

dick

.gnupg

gpg.conf

.gnupg

secring

pubring

gpg.conf

.gnupg

pubring

gpg.conf

pubring

secring

secring
David Morgan 2006-2013

gpg key management options




--gen-key
create keypair and store on disk

--export
take public key from disk and output to file

--import
take public key from file and output to disk

David Morgan 2006-2013

13

gpg encryption options




--encrypt <file> --recipient <user>


encrypt file with users pubkey from disk

--decrypt <file>
decrypt file using private key from disk that
matches public key with which file was
encrypted

David Morgan 2006-2013

gpg signing options




--sign <file>
create digest of file, encrypt it with private key

--verify
decrypt senders digest, generate your own,
check theyre the same

David Morgan 2006-2013

14

Example: believing in fedora


2) signature on
digests file makes
it believable

1) this files digests,


for the other files,
make them believable

David Morgan 2006-2013

Get fedora projects public key

David Morgan 2006-2013

15

Add fedoras key to your keyring

David Morgan 2006-2013

Use it: file really from fedora?

if the key is really fedoras,


the file is really from them
we believe so
David Morgan 2006-2013

16

ostensible

per fedora and we believe it!

Do downloads check out?

OK, except
actual

whats up with disc2 ??

David Morgan 2006-2013

gpa GUI frontend to gpg

David Morgan 2006-2013

17

Enigmail integrates GPG+email

Others: http://www.gnupg.org/related_software/frontends.html

David Morgan 2006-2013

Info


official page
http://www.gnupg.org

GPG Mini HowTo


good, quick bare essentials
http://www.dewinter.com/gnupg_howto/
english/GPGMiniHowto.html

GNU Privacy Handbook


more thorough and explanatory
http://www.gnupg.org/gph/en/manual.html

RFC4880 (OpenPGP message format)


David Morgan 2006-2013

18