1.62k likes | 1.98k Views
Week 2 Cryptography. Cryptography Concepts. Every night in my dream I see you I feel you that Is how I know you Go on far away a Cross the distance. in night Every dream I you see my I you that feel know you Is how I Go away a on far distance Cross the. Cryptography. Latin.
E N D
Week 2 Cryptography
Cryptography Concepts
Every night in my dream I see you I feel you that Is how I know you Go on far away a Cross the distance in night Every dream I you see my I you that feel know you Is how I Go away a on far distance Cross the Cryptography Latin Crypt secret Cryptography Graphia writing • Concerned with developing algorithms: • Conceal the context of some message from all • except the sender and recipient (privacy or secrecy), • and/or
Cryptography • Concerned with developing algorithms: • Verify the correctness of a message to the recipient • (authentication) • Form the basis of many technological solution to computer • and communications security problems cryptography - study of encryption principles/methods
Sender Receiver Goals & Setting • To ensure security of communication across • an insecure channel. • The ideal channel: Dedicated, untappable, impenetrable Pipe/tube
Secure Channel ISP/Office
Secure Channel Authenticated
Secure Channel Connected
Secure Channel Connection Established ISP/Office
Sender Receiver Goal & Setting Adversary (Attacker) The source of all possible threats Not all aspect of an ideal channel can be emulated
Basic Terminology • plaintext - the original message • ciphertext - the coded message • cipher - algorithm for transforming plaintext to ciphertext • key - info used in cipher known only to sender/receiver • encipher (encrypt) - converting plaintext to ciphertext • decipher (decrypt) - recovering ciphertext to plaintext
Simple Process Receiver Sender Plaintext Plaintext The secret message is: You can get A-/A+ in SKR5200; (however depend on you) The secret message is: You can get A-/A+ in SKR5200; (however depend on you) Encryption Decryption ciphertext hjfjghkf@#@#$%^&jklll 098GHJFD!@#$#$#$%
Encryption Method Cryptography Symmetric Encryption Asymmetric Encryption • uses two keys – a public & a private key • asymmetric since parties are not equal • uses clever application of number • theoretic concepts to function • complements rather than replaces • private key crypto • conventional / private-key / single-key • sender and recipient share a common key • all classical encryption algorithms are • private-key
Symmetric Encryption Technique Symmetric Encryption Classical Modern Stream cipher Block cipher
Symmetric Encryption • conventional / private-key / single-key • sender and recipient share a common key • 2 Techniques: Classical & Modern • Classical Techniques: • Substitution: • Caesar Cipher • Monalphabatic Cipher • Playfair Cipher • Hill Cipher • Polyalphabetic Cipher • One-Time Pad • Transposition • Rotor Machines • Steganography • Modern Techniques: • DES, 3DES, AES
Basic of Symmetric Cryptography Classical Substitution Cipher Classical Transpositions Cipher Summary
Symmetric Encryption • or conventional / private-key / single-key • sender and recipient share a common key • all classical encryption algorithms are private-key • was only type prior to invention of public-key in 1970’s
Basic Terminology • plaintext - the original message • ciphertext - the coded message • cipher - algorithm for transforming plaintext to ciphertext • key - info used in cipher known only to sender/receiver • encipher (encrypt) - converting plaintext to ciphertext • decipher (decrypt) - recovering ciphertext from plaintext • cryptography - study of encryption principles/methods • cryptanalysis (codebreaking) - the study of principles/ methods of deciphering ciphertext without knowing key • cryptology - the field of both cryptography and cryptanalysis
Requirements • two requirements for secure use of symmetric encryption: • a strong encryption algorithm • a secret key known only to sender / receiver, have: • plaintext X • ciphertext Y • key K • encryption algorithm Ek • decryption algorithm Dk Ciphertext Y = EK(X) Plaintext X = DK(Y) • assume encryption algorithm is known • implies a secure channel to distribute key
Cryptography • can characterize by: • type of encryption operations used • substitution / transposition / product • number of keys used • single-key or private / two-key or public • way in which plaintext is processed • block / stream
Types of Cryptanalytic Attacks • ciphertext only • only know algorithm / ciphertext, statistical, can identify plaintext • known plaintext • know/suspect plaintext & ciphertext to attack cipher • chosen plaintext • select plaintext and obtain ciphertext to attack cipher • chosen ciphertext • select ciphertext and obtain plaintext to attack cipher • chosen text • select either plaintext or ciphertext to en/decrypt to attack cipher
Simple Question • What are the essential ingredients of a symmetric cipher? • How many keys are required for two people to communicate via a cipher?
Simple Question • What are the essential ingredients of a symmetric cipher? Plaintext, encryption algorithm, secret key, ciphertext, decryption algorithm. • How many keys are required for two people to communicate via a cipher? One secret key.
Basic of Symmetric Cryptography Classical Substitution Cipher Classical Transpositions Cipher Summary
Classical Substitution Ciphers • where letters of plaintext are replaced by other letters or by numbers or symbols • or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with ciphertext bit patterns
Caesar Cipher • earliest known substitution cipher • by Julius Caesar • first attested use in military affairs • replaces each letter by 3rd letter on • example: meet me after the toga party PHHW PH DIWHU WKH WRJD SDUWB
Caesar Cipher • can define transformation as: Plain: a b c d e f g h i j k l m n o p q r s t u v w x y z Cipher:D E F G H I J K L M N O P Q R S T U V W X Y Z A B C • mathematically give each letter a number a b c d e f g h i j k l m 0 1 2 3 4 5 6 7 8 9 10 11 12 n o p q r s t u v w x y Z 13 14 15 16 17 18 19 20 21 22 23 24 25 • then have Caesar cipher as: C = E(p) = (p + k) mod (26) p = D(C) = (C – k) mod (26)
Example 1 • Caesar used a shift of 3 • Using this encryption, the message: • treaty impossible • Would be encoded as : • t r e a t y i m p o s s i b l e • WUHDWB LP S RVVLEOH
Example 2 • Caesar used a shift of 5 • Using this encryption, the message: • treaty impossible • Would be encoded as : • t r e a t y i m p o s s i b l e
To test your understanding Ceasar wants to arrange a secret meeting with Marc Anthony, either at the Tiber (the river) or at the Colisuem (the arena). He sends the ciphertext EVIRE. However, Anthony doest not know the key, so he tries all possibilities. Where will he meet Caesar?
To test your understanding Ceasar wants to arrange a secret meeting with Marc Anthony, either at the Tiber (the river) or at the Colisuem (the arena). He sends the ciphertext EVIRE. However, Anthony doest not know the key, so he tries all possibilities. Where will he meet Caesar? Among the shifts of EVIRE, there are two words: arena and river. Therefore, Anthony cannot determine where to meet Caesar.
Cryptanalysis of Caesar Cipher • only have 26 possible ciphers • A maps to A,B,..Z • could simply try each in turn • a brute force search • given ciphertext, just try all shifts of letters • do need to recognize when have plaintext • eg. break ciphertext "GCUA VQ DTGCM"
Summary of Substitutions Substitutions are effective cryptographic devices. In fact, they were the basis of many cryptographic algorithms used for diplomatic communication through the first half of the century. But substitution is not only kind of encryption technique. The goal of substitution is confusion; the encryption method is an attempt to make it difficult for cryptanalyst or intruder to determine how a message and key were transformed into ciphertext.
Basic of Symmetric Cryptography Classical Substitution Cipher Classical Transpositions Cipher Summary
Transpositions (permutations) A transposition is an encryption in which the letters of the message are re arranged. With transposition is an encryption in which the letters of the message are rearranged. With transposition, the cryptography aims for diffusion, widely spreading the information from the message or key across the ciphertext. Transpositions try to break established patterns. Because a transposition is re arranged of the symbols of a message, it also known as a permutation.
Transposition Ciphers • now consider classical transposition or permutation ciphers • these hide the message by rearranging the letter order • without altering the actual letters used • can recognise these since have the same frequency distribution as the original text
m e m a t r h t g p r y e t e f e t e o a a t Rail Fence cipher • write message letters out diagonally over a number of rows • then read off cipher row by row • eg. write message out as: “meet me after the toga party” • giving ciphertext MEMATRHTGPRYETEFETEOAAT
Row Transposition Ciphers • a more complex scheme is to write the message in a rectangle, row by row, and read the message off, column by column, but permute the order of the columns. The order of the columns then becomes the key of the algorithm. • write letters of message out in rows over a specified number of columns • then reorder the columns according to some key before reading off the rows Key: 4 3 1 2 5 6 7 Plaintext: a t t a c k p o s t p o n e d u n t i l t w o a m x y z Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
Product Ciphers • ciphers using substitutions or transpositions are not secure because of language characteristics • hence consider using several ciphers in succession to make harder, but: • two substitutions make a more complex substitution • two transpositions make more complex transposition • but a substitution followed by a transposition makes a new much harder cipher • this is bridge from classical to modern ciphers
Basic of Symmetric Cryptography Classical Substitution Cipher Classical Transpositions Cipher Summary