Cryptography Cryptography secret- -key and and public key and and public- -key technologies key technologies secret September 4, 2020
Administrative – – getting VM files getting VM files Administrative new
Administrative – – VM usage VM usage Administrative new info
Administrative – – upcoming lab upcoming lab Administrative � read instructions before labtime – in general, advance examination a good idea – in particular, first part of RSA instructions this week, plus narrated lecture at link on class website entitled “My RSA lecture available online”
Administrative – – submittal instructions submittal instructions Administrative � answer the lab assignment’s questions in written report form, as a text, pdf, or Word document file (no obscure formats please) � email to csci530l@usc.edu r e t l i f ! r u u o O y s k n a h t � exact subject title must be “cryptolab” � deadline is start of your lab session the following week � reports not accepted (zero for lab) if – late – you did not attend – email subject title deviates
This lab exercise uses… … This lab exercise uses � GPG (GNU Privacy Guard) – implements OpenPGP "GnuPG is the GNU project's...implementation of the OpenPGP standard..." � OpenPGP – a cryptography standard RFC4880 “OpenPGP … provide[s]…confidentiality, key management, authentication, and digital signatures” � bc – an arbitrary precision calculator able to perform the arithmetic necessary to operate the RSA algorithm
Crypto covered in this lecture or lab? Crypto covered in this lecture or lab? cryptographic historical instances elemental* data lab exercises technology transformation method(s) used secret-key Japanese Naval carryless addition none Code 25 (JN-25) & half-borrow … ! ! e subtraction m i t h g u o n e t o Data Encryption serial substitutions simplified-des N ! ! Standard (DES) & permutations (omitted) public-key Rivest-Shamir- modular arithmetic manual RSA Adelman operation with the algorithm (RSA) bc calculator Digital Signature modular arithmetic keys, encryption, Algorithm (DSA) signing with GPG *Ultimately all ciphers are substitution ciphers in that, ultimately, they substitute ciphertext for plaintext! But this characterizes what the cipher does to each “element” of the plaintext (e.g., byte or block), as it processes elements.
JN- -25 25 JN
A real- -world secret world secret- -key substitution cipher key substitution cipher A real Japanese Navy Code JN- -25 25 Japanese Navy Code JN conceptual demonstration conceptual demonstration � in ciphertext a Japanese word appears as a number – a 5-decimal-digit number (digits chosen randomly) – called a “ code group ” [of digits] � the ciphertext code group is generated as � two other code groups – one assigned to the word (constant hard mapping, belonging to the word) – the other corresponded to that word (variable, soft mapping)
First code group for a word First code group for a word � drawn from the “codebook” � amounts to a dictionary � entries are fixed English demo example code book: Code group Word 39318 apples 95280 bananas 80514 eat 72084 I 41712 like 64479 you
A codebook A codebook Japanese codebook from 1933 on display at Bletchley Park Museum
An example An example the Zimmerman note the Zimmerman note A message enciphered through a word-to-number codebook “dictionary.” The numbers map to German words. (The note, from Germany proposing that Mexico go to war with the US, was intercepted, decoded, and publicized. It catalyzed US entry into World War I soon after.)
Footnote: WWI Footnote: WWI
GPG GPG and public- -key cryptography generally, key cryptography generally, and public of which it is an implementation of which it is an implementation
Functional purposes of cryptograhy cryptograhy Functional purposes of � Confidentiality – ensuring illegibility to outsiders � Authentication – ensuring ostensible and actual sender are one and the same � Data integrity – ensuring non-alteration in transit
Cryptographic processing Cryptographic processing Encryption Decryption (data sender) (data receiver) plaintext cryptogram cipher inverse cipher cryptogram plaintext
2 broad technologies 2 broad technologies � Secret-key cryptography versus � Public-key cryptography ������������� ���� � � � � � � � �
Known synonymously as: Known synonymously as: � One technology � Versus the other – single-key – dual-key – private-key – public-key – symmetric – asymmetric – secret-key – shared-key – conventional What a pity! this poor choice of words
Key usage, per technology Key usage, per technology Which key encrypts? Which key decrypts? secret the only key! the only key! the public key the private key public !!-OR-!! the private key the public key
Keys: secret- -key crypto key crypto Keys: secret Encryption Decryption (data sender) (data receiver) plaintext cryptogram (same key) cipher inverse cipher cryptogram plaintext
Keys: public- -key crypto key crypto Keys: public Encryption Decryption plaintext cryptogram (different cipher inverse cipher key) cryptogram plaintext
Wait a minute… … Wait a minute � 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?
Well… … Well � Only public keys can be sent! � So either guy could be the key sender � And he would send his public key (only! ever!) � Depending who sends, accomplishes � confidentiality, or � authentication
Data receiver as key sender Data receiver as key sender Key sender Encryption Decryption (data sender) (data receiver) plaintext cryptogram (data receiver’s cipher inverse cipher private key) cryptogram plaintext Key sent (data receiver’s public key)
Functional achievement checklist Functional achievement checklist Data receiver as key sender Data receiver as key sender � Confidentiality � Authentication � Data integrity
Data sender as key sender Data sender as key sender Key sender Encryption Decryption (data sender) (data receiver) plaintext cryptogram (data cipher inverse cipher sender’s private key) cryptogram plaintext Key sent (data sender’s public key)
Functional achievement checklist Functional achievement checklist Data sender as key sender Data sender as key sender � Confidentiality � Authentication � Data integrity
But can’ ’t we have both together? t we have both together? But can � Confidentiality � Authentication � Data integrity Certainly! if you just encrypt and decrypt twice
Encrypting the whole message Encrypting the whole message twice is too expensive!! twice is too expensive!! � Make a little token 1 from a big message with a hash function 2 � Encrypt the token instead of the message 1 also called a message digest or hash 2 also called a digest function, like MD5 or SHA1 or RIPEMD-160 (note: MD5 and SHA1, used only for illustration in following screenshots, are deprecated due to weaknesses found in recent years)
What is a message digest (a.k.a. hash) What is a message digest (a.k.a. hash) � a value (digest) derived from a body of data (message) � by application of an algorithmic function � applied on all of the data (all bits) digest = f ( message )
Digest function characteristics Digest function characteristics � digest length constant (per particular function) � digest characteristic of (if not unique to) message � big digest variation for slight message variation � irreversible, one-way, inverseless
digest length constant (per function) digest length constant (per function) Familiar short text Familiar long text same 16-byte MD5 digest length, for each same 20-byte SHA1 digest length, for each
Digest is characteristic of message; Digest is characteristic of message; Slight input change - -> big output change > big output change Slight input change “Authorized” occurs only once A=01000001 change only one bit in the whole file C=01000011 digest changes radically revert file to its original identically digest reverts to its original identically
irreversible, one- -way, way, inverseless inverseless irreversible, one � few-byte digest for unbounded message � impossible sufficient information could reside in scant input to reconstruct input
* Confidential and and authentic authentic * Confidential Encryption Decryption (data sender) (data receiver) * gpg’s encrypt and sign H cryptogram sender’s private S plaintext receiver’s private inverse cipher cipher receiver’s public S plaintext sender’s public cryptogram H H H - hash OK if same S - signature
…buys data integrity to boot! buys data integrity to boot! … � Confidentiality � Authentication � Data integrity Inclusion of hash buys data integrity because it is “genetically unique” to the data sent.
Recommend
More recommend