CIT 380: Securing Computer Systems Cryptography Basics CIT 380: Securing Computer Systems
CIT 380: Securing Computer Systems Topics Cryptographic Concepts History of Cryptography Symmetric Encryption Public Key Encryption Digital Signatures Message Authentication Codes CIT 380: Securing Computer Systems
Cryptographic Concepts Encryption: a means to allow two parties to establish confidential communication over an insecure channel that is subject to eavesdropping. Alice Bob Eve
Encryption and Decryption The message M is called the plaintext. Alice will convert plaintext M to an encrypted form using an encryption algorithm E that outputs a ciphertext C for M. encrypt decrypt ciphertext plaintext shared secret key Communication channel Sender Recipient Attacker (eavesdropping)
Encryption and Decryption As equations: C = E(M) M = D(C) The encryption and decryption algorithms are chosen so that it is infeasible for someone other than Alice and Bob to determine plaintext M from ciphertext C. Thus, ciphertext C can be transmitted over an insecure channel that can be eavesdropped by an adversary.
Cryptosystem The set of possible plaintexts The set of possible ciphertexts The set of encryption keys The set of decryption keys The correspondence between encryption keys and decryption keys The encryption algorithm to use The decryption algorithm to use
Caesar Cipher Replace each letter with the one “three over” in the alphabet. Public domain image from http://commons.wikimedia.org/wiki/File:Caesar3.svg
Kerckhoff’s Principle Security of cryptosystem should only depend on Quality of shared encryption algorithm E Secrecy of key K Security through obscurity tends to fail ex: DVD Content Scrambling System http://www.math.ucsd.edu/~crypto/Projects/MarkBarry/index.htm
Early Cryptography Egyptian hieroglyphics ~ 2000 B.C.E. Cryptic tomb enscriptions for regality. Spartan skytale cipher ~ 500 B.C.E. Wrapped thin sheet of papyrus around staff. Messages written down length of staff. Decrypted by wrapped around = diameter staff. Cæsar cipher ~ 50 B.C.E. Simple alphabetic substitution cipher. al-Kindi ~ 850 C.E. Cryptanalysis using letter frequencies. Images from http://en.wikipedia.org/wiki/Cryptography#History_of_cryptography_and_cryptanalysis and http://en.wikipedia.org/wiki/Hieroglyphics
Vigènere Cipher (1553) Use phrase instead of letter as key. Example Message THE BOY HAS THE BALL Key VIG Encipher using Cæsar cipher for each letter: key VIGVIGVIGVIGVIGV plain THEBOYHASTHEBALL cipher OPKWWECIYOPKWIRG http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher
The World Wars Decryption of Zimmerman telegram 1917 Leads US into World War I Japanese Purple Machine cracked 1937 US breaks rotor machine for highest secrets. German Enigma machine cracked 1933-45 Initially broken by Polish mathematician Variants broken at Bletchley Park in UK Colossus, world’s 1st electronic computer. http://en.wikipedia.org/wiki/Alberti_Cipher_Disk http://en.wikipedia.org/wiki/Zimmerman_telegram http://en.wikipedia.org/wiki/Enigma_machine
Symmetric Cryptosystems Alice and Bob share a secret key, which is used for both encryption and decryption. encrypt decrypt ciphertext plaintext shared secret key Communication channel Sender Recipient Attacker (eavesdropping)
Symmetric Key Distribution Requires each pair of communicating parties to share a (separate) secret key. shared secret shared secret shared secret shared secret shared secret n (n-1)/2 keys shared secret
Public-Key Cryptography Bob has two keys: a private key, SB, which Bob keeps secret, and a public key, PB, which Bob broadcasts widely. In order for Alice to send an encrypted message to Bob, she need only obtain his public key, PB, use that to encrypt her message, M, and send the result, C = EPB (M), to Bob. Bob then uses his secret key to decrypt the message as M = DSB (C).
Public-Key Cryptography Separate keys for encryption and decryption. encrypt decrypt ciphertext plaintext public key private Communication channel Sender Recipient Attacker (eavesdropping)
Public Key Distribution Only one key is needed for each recipient n key pairs private public
Why Johnny Can’t Encrypt Usability evaluation of PGP 5.0 Pretty Good Privacy Encrypts data Plugins for e-mail clients Results of study of 12 users 3 users sent e-mail without encryption (2 of 3 realized) 7 users used public key instead of private key to encrypt Only 2 users could decrypt without problems
Digital Signatures Public-key encryption provides a method for doing digital signatures To sign a message, M, Alice just encrypts it with her private key, SA, creating C = ESA(M). Anyone can decrypt this message using Alice’s public key, as M’ = DPA(C), and compare that to the message M.
Secure Hash Functions A secure hash function or message authentication code (MAC) is a checksum on a message, M, with the following properties: One-way: it should be easy to compute Y=H(M), but hard to find M given only Y. Collision-resistant: it should be hard to find two messages, M and N, such that H(M)=H(N). Examples: MD5, SHA-1, SHA-256. Images from http://www.iaik.tugraz.at/content/research/krypto/sha1/SHA1CollisionBasics.php.
Message Authentication Codes Allows for Alice and Bob to have data integrity, if they share a secret key. Given a message M, Alice computes H(K||M) and sends M and this hash to Bob. (attack detected) =? MAC h shared secret key Communication channel Sender Recipient Attacker (modifying) 6B34339 4C66809 message M’ 87F9024 received MAC computed MAC message M
CIT 380: Securing Computer Systems References Anderson, Security Engineering 2nd Edition, Wiley, 2008. Bishop, Computer Security: Art and Science, Addison-Wesley, 2002. Goodrich and Tammasia, Introduction to Computer Security, Pearson, 2011. CIT 380: Securing Computer Systems