Basic Cryptography Presentation
Basic Cryptography Presentation
BY FULLGENCE MWAKONDO
8: Network Security
8-1
Reference
Notes on cryptography :By Peter J. Cameron,
School of Mathematical Sciences, Queen Mary, University of London, Mile End Road London E1 4NS,UK An introduction to cryptography and cryptanalysis: By Edward Schaefer, Santa Clara University
Computer
8: Network Security
8-2
roadmap
1.
2.
3. 4. 5. 6.
Introduction to cryptography Principles of cryptography Types of cryptography Authentication Integrity Key Distribution and certification
8: Network Security
8-3
Cryptography
Refers to the art of protecting transmitted
information from unauthorized interception or tampering. cryptanalysis, is the art of breaking such secret ciphers and reading the information, or perhaps replacing it with different information. cryptology , is the study of encryption and decryption and cryptography is the application of them.
8: Network Security
8-4
kind (text, scientific data, pictures, sound, and so on) into a standard form for transmission, and protecting this information against distortion by random noise. Cryptography involves protecting information against purposeful interference by enemy They both protect information but use different techniques
8: Network Security
8-5
and hope that the enemy cant find it. Cryptography involves scrambling the message, and hope that (assuming that it is intercepted) the enemy is unable to unscramble it They both keep a message out of the enemys hands
8: Network Security
8-6
roadmap
1.
2.
3. 4. 5. 6.
Introduction to cryptography Principles of cryptography Types of cryptography Authentication Integrity Key Distribution and certification
8: Network Security
8-8
Cryptography Terms
plaintext: the message to be communicated
ciphertext: disguised message actually transmitted encryption: process of creating a ciphertext from a
plaintext decryption: process of turning a ciphertext back into a plaintext Key: extra information needed to do encryption and decryption Cipher: cryptographic(encrypt ,decrypt) algorithm Stream cipher:Encrypt message character at a time Block cipher: Encrypt message a chunk8:at a Security 8-9 Network time
to communicate are called Alice and Bob, and the eavesdropper(enemy) who is trying to read their message is Eve/Trudy. Alice and Bob both have access to the key, but Eve doesnt. The black boxes input plaintext and key and output ciphertext (in Alices case), or input ciphertext and key and output plaintext (in Bobs).
8: Network Security
8-10
8: Network Security
8-11
channel
Bob
data
secure receiver
Trudy
data
8: Network Security
8-12
transactions (e.g., on-line purchases) on-line banking client/server DNS servers routers exchanging routing table updates other examples?
8: Network Security
8-13
eavesdrop: intercept messages actively insert messages into connection impersonation: can fake (spoof) source address
in packet (or any field in packet) hijacking: take over ongoing connection by removing sender or receiver, inserting himself in place denial of service: prevent service from being used by others (e.g., by overloading resources)
Transposition encryption/cipher
Pig-Latin cipher
For words which begin with a single consonant take the consonant off the front of the word and add it to the end of the word. Then add ay after the consonant E.g. cat = atcay For words which begin with double or multiple consonants take the group ofconsonants off the front of the word and add them to the end, adding ay at the very end of the word. E.g. scratch = atchscray For words that begin with a vowel, just add yay at the end E.g. apple = appleyay 8: Network Security 8-16
Substitution encryption/cipher
Caesar cipher
Each
letter is shifted a fixed number of places to the right. (Caesar normally used a shift of three places). We regard the alphabet as a cycle, so that the letter following Z is A. Thus, for example, the table below shows a right shift of 5 places. A B C D E F G H I J K L M N OP Q R S T U V W X Y Z F G H I J K L M N O P Q R S T U V W X YZ AB C D E
Monoalphabetic cipher
8: Network Security
8-18
roadmap
1.
2.
3. 4. 5. 6.
Introduction to cryptography Principles of cryptography Types of cryptography Authentication Integrity Key Distribution and certification
8: Network Security
8-19
Types of cryptography
Symmetric key cryptography(classical
8: Network Security
8-20
symmetric key crypto: sender, receiver keys identical public-key crypto: encryption key public, decryption key secret (private)
8: Network Security 8-21
plaintext: ciphertext:
E.g.:
abcdefghijklmnopqrstuvwxyz mnbvcxzasdfghjklpoiuytrewq
Plaintext: bob. i love you. alice ciphertext: nkn. s gktc wky. mgsbc
Q: How hard to break this simple cipher?: brute force (how hard?) other?
8: Network Security 8-22
KA-B
decryption plaintext algorithm m = K ( KA-B(m) )
A-B
symmetric key crypto: Bob and Alice know and share same (symmetric) key: K A-B e.g., key is knowing substitution pattern in mono alphabetic substitution cipher Q: how do Bob and Alice agree on key value?
8: Network Security 8-23
DES Challenge: 56-bit-key-encrypted phrase (Strong cryptography makes the world a safer place) decrypted (brute force) in 4 months no known backdoor decryption approach making DES more secure: use three keys sequentially (3-DES) on each datum use cipher-block chaining
receiver know shared secret key Q: how to agree on key in first place (particularly if never met)?
approach [DiffieHellman76, RSA78] sender, receiver do not share secret key public encryption key known to all private decryption key known only to receiver Q:how to choose keys?
8: Network Security 8-25
plaintext message, m
8: Network Security
8-26
Q:how to choose keys? Soln: RSA (Rivest, Shamir, Adelson algorithm) 8: Network Security
8-27
PAUSE
8: Network Security
8-28
roadmap
1.
2.
3. 4. 5. 6.
Introduction to cryptography Principles of cryptography Types of cryptography Authentication Integrity Key Distribution and certification
8: Network Security
8-29
Authentication
Goal: Bob wants Alice to prove her identity to him
Protocol ap1.0: Alice says I am Alice I am Alice
Failure scenario??
8: Network Security
8-30
Authentication
Goal: Bob wants Alice to prove her identity to him
Protocol ap1.0: Alice says I am Alice in a network, Bob can not see Alice, so Trudy simply declares herself to be Alice
8: Network Security 8-31
I am Alice
Failure scenario??
8: Network Security
8-32
Alices IP address
8: Network Security
8-33
OK
Failure scenario??
8: Network Security
8-34
OK
8: Network Security
8-35
OK
Failure scenario??
8: Network Security
8-36
OK
8: Network Security
8-37
ap4.0: to prove Alice live, Bob sends Alice nonce, R. Alice must return R, encrypted with shared secret key I am Alice R
KA-B(R) Failures, drawbacks?
Alice is live, and only Alice knows key to encrypt nonce, so it must be Alice!
8: Network Security 8-38
Authentication: ap5.0
ap4.0 requires shared symmetric key can we authenticate using public key techniques? ap5.0: use nonce, public key cryptography
I am Alice R K A (R) KA
+ -
and knows only Alice could have the private key, that encrypted R such that + K (K (R)) = R A A
8: Network Security 8-39
KA(KA (R)) = R
Bob computes + -
K (R) A
+ K A
+ K T
- + m = K (K (m)) A A
+ K (m) A
+ K (m) T
Difficult to detect: Bob receives everything that Alice sends, and vice versa. (e.g., so Bob, Alice can meet one week later and recall conversation) problem is that Trudy receives all messages as well!
8: Network Security
8-41
roadmap
1.
2.
3. 4. 5. 6.
Introduction to cryptography Principles of cryptography Types of cryptography Authentication Integrity Key Distribution and certification
8: Network Security
8-42
Digital Signatures
Cryptographic technique analogous to handwritten signatures.
sender (Bob) digitally signs document,
establishing he is document owner/creator. verifiable, nonforgeable: recipient (Alice) can prove to someone that Bob, and no one else (including Alice), must have signed document
8: Network Security
8-43
Digital Signatures
Simple digital signature for message m:
Bob signs m by encrypting with his private key -
Bobs message, m
Dear Alice
Oh, how I have missed you. I think of you all the time! (blah blah blah)
key
K B(m)
Bobs message, m, signed (encrypted) with his private key
Bob
8: Network Security
8-44
Alice thus verifies that: Bob signed m. No one else signed m. Bob signed m and not m. Non-repudiation: Alice can take m, and signature KB(m) to court and prove that Bob signed m.
8: Network Security 8-45
Message Digests
Computationally expensive to public-key-encrypt long messages Goal: fixed-length, easyto-compute digital fingerprint apply hash function H to m, get fixed size message digest, H(m).
large message m
H: Hash Function
H(m)
Hash function properties: many-to-1 produces fixed-size msg digest (fingerprint) given message digest x, computationally infeasible to find m such that x = H(m)
8: Network Security 8-46
H(m)
digital signature (encrypt) encrypted msg digest
KB
large message m
H: Hash function
KB(H(m))
KB
KB(H(m))
H(m)
H(m)
equal ?
8: Network Security 8-48
computes 128-bit message digest in 4-step process. arbitrary 128-bit string x, appears difficult to construct msg m whose MD5 hash is equal to x. SHA-1 is also used. US standard [NIST, FIPS PUB 180-1] 160-bit message digest
8: Network Security
8-49
roadmap
1.
2.
3. 4. 5. 6.
Introduction to cryptography Principles of cryptography Types of cryptography Authentication Integrity Key Distribution and certification
8: Network Security
8-50
Trusted Intermediaries
Symmetric key problem:
How do two entities
Solution:
trusted key distribution
Bobs public key (from web site, e-mail, diskette), how does she know it is Bobs public key, not Trudys?
Solution:
trusted certification
authority (CA)
8: Network Security
8-51
registered user (many users) Alice, Bob know own symmetric keys, KA-KDC KB-KDC , for communicating with KDC. KDC
KP-KDC KB-KDC KA-KDC KP-KDC KX-KDC KY-KDC KB-KDC KZ-KDC
each
KA-KDC
8: Network Security
8-52
KA-KDC(A,B)
Alice knows R1
Alice and Bob communicate: using R1 as session key for shared symmetric encryption
8: Network Security 8-53
Certification Authorities
Certification authority (CA): binds public key to
particular entity, E. E (person, router) registers its public key with CA.
E provides proof of identity to CA. CA creates certificate binding E to its public key. certificate containing Es public key digitally signed by CA CA says this is Es public key
Bobs public key
KB
K-
CA
Certification Authorities
When Alice wants Bobs public key:
gets Bobs certificate (Bob or elsewhere). apply CAs public key to Bobs certificate, get Bobs public key
+ KB
+ K CA
8: Network Security
8-55
A certificate contains:
Serial number (unique to issuer) info about certificate owner, including algorithm
info about
8: Network Security
8-56
END OF PRESENTATION
8: Network Security
8-58