680 likes | 785 Views
ET4085/ET5085 Keamanan Jaringan Telekomunikasi ET4085/ET5085 Telecommunication Network Security . Tutun Juhana Telecommunication engineering School of electrical engineering & informatics Institut teknologi bandung http://telecommunication.itb.ac.id/~tutun/ET4085. Cryptography.
E N D
ET4085/ET5085 KeamananJaringanTelekomunikasiET4085/ET5085 Telecommunication Network Security Tutun Juhana Telecommunication engineering School of electrical engineering & informatics Institut teknologi bandung http://telecommunication.itb.ac.id/~tutun/ET4085 http://wp.me/P29YQz-k
Cryptography http://wp.me/P29YQz-k
Definition • Came from Greek cryptography krupto(hidden or secret) and grafh(written) • Art of secret writing http://wp.me/P29YQz-k
User Authentication Services Provided by Cryptography http://wp.me/P29YQz-k
Data Authentication • Data integrity Data Integrity http://wp.me/P29YQz-k
Data origin authentication B A He can claim that he is A http://wp.me/P29YQz-k
Non-repudiation of origin http://wp.me/P29YQz-k
Data confidentiality • ? http://wp.me/P29YQz-k
Friends and enemies: Alice, Bob, Trudy well-known in network security world Bob, Alice (lovers!) want to communicate “securely” Trudy (intruder) may intercept, delete, add messages http://wp.me/P29YQz-k
Who might Bob, Alice be? Real-life Bobs and Alices! Web browser/server for electronic transactions (e.g., on-line purchases) on-line banking client/server DNS servers routers exchanging routing table updates etc. http://wp.me/P29YQz-k
The language of cryptography m plaintext message KA(m) ciphertext, encrypted with key KA m = KB(KA(m)) symmetric key crypto: sender, receiver keys identical public-key crypto: encryption key public, decryption key secret (private) http://wp.me/P29YQz-k
Symmetric key cryptography • symmetric key crypto: Bob and Alice share known same (symmetric) key: KAB • e.g., key is knowing substitution pattern in mono alphabetic substitution cipher http://wp.me/P29YQz-k
substitution cipher: substituting one thing for another • monoalphabetic cipher: substitute one letter for another http://wp.me/P29YQz-k
Deciphering techniques (attacks on a cryptosystem) • Cipher-text only attack: no clue about contents of message: statistical analysis • Known-plaintext attack: trudy has some plaintext for some ciphertext • eg, in monoalphabetic cipher, trudy determines pairings for a,l,i,c,e,b,o • Chosen-plaintext attack: trudy can get the cyphertext for some chosen plaintext • Eg, Trudy masquerades as Alice http://wp.me/P29YQz-k
Statistical analysis example A typical distribution of letters in English language text http://wp.me/P29YQz-k
Suppose we have intercepted the cipher-text below, and it is known to be encrypted using a simple substitution cipher • LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIPFEMVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERIM WQLMGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEVEKEITREWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXRSJ GSTVRIEYVIEXCVMUIMWERGMIWXMJMGCSMWXSJOMIQXLIVIQIVIXQSVSTWHKPEGARCSXRWIEVSWIIBXV IZMXFSJXLIKEGAEWHEPSWYSWIWIEVXLISXLIVXLIRGEPIRQIVIIBGIIHMWYPFLEVHEWHYPSRRFQMXLE PPXLIECCIEVEWGISJKTVWMRLIHYSPHXLIQIMYLXSJXLIMWRIGXQEROIVFVIZEVAEKPIEWHXEAMWYEPP XLMWYRMWXSGSWRMHIVEXMSWMGSTPHLEVHPFKPEZINTCMXIVJSVLMRSCMWMSWVIRCIGXMWYMX • For this example, uppercase letters are used to denote ciphertext, lowercase letters are used to denote plaintext (or guesses at such), and X~t is used to express a guess that ciphertext letter X represents the plaintext letter t. • We could use frequency analysis to help solve the message along the following lines: counts of the letters in the cryptogram show that I is the most common single letter, XL most common bigram, and XLI is the most common trigram. e is the most common letter in the English language, th is the most common bigram, and the is the most common trigram. This strongly suggests that X~t, L~h and I~e. The second most common letter in the cryptogram is E; since the first and second most frequent letters in the English language, e and t are accounted for, We guess that E~a, the third most frequent letter. Tentatively making these assumptions, the following partial decrypted message is obtained. http://wp.me/P29YQz-k
heVeTCSWPeYVaWHaVSReQMthaYVaOeaWHRtatePFaMVaWHKVSTYhtZetheKeetPeJVSZaYPaRRGaReM WQhMGhMtQaReWGPSReHMtQaRaKeaTtMJTPRGaVaKaeTRaWHatthattMZeTWAWSQWtSWatTVaPMRtRSJ GSTVReaYVeatCVMUeMWaRGMeWtMJMGCSMWtSJOMeQtheVeQeVetQSVSTWHKPaGARCStRWeaVSWeeBtV eZMtFSJtheKaGAaWHaPSWYSWeWeaVtheStheVtheRGaPeRQeVeeBGeeHMWYPFhaVHaWHYPSRRFQMtha PPtheaCCeaVaWGeSJKTVWMRheHYSPHtheQeMYhtSJtheMWReGtQaROeVFVeZaVAaKPeaWHtaAMWYaPP thMWYRMWtSGSWRMHeVatMSWMGSTPHhaVHPFKPaZeNTCMteVJSVhMRSCMWMSWVeRCeGtMWYMt • Using these initial guesses, We can spot patterns that confirm our choices, such as "that". Moreover, other patterns suggest further guesses. "Rtate" might be "state", which would mean R~s. Similarly "atthattMZe" could be guessed as "atthattime", yielding M~i and Z~m. Furthermore, "heVe" might be "here", giving V~r. Filling in these guesses, We get: • hereTCSWPeYraWHarSseQithaYraOeaWHstatePFairaWHKrSTYhtmetheKeetPeJrSmaYPassGasei WQhiGhitQaseWGPSseHitQasaKeaTtiJTPsGaraKaeTsaWHatthattimeTWAWSQWtSWatTraPistsSJ GSTrseaYreatCriUeiWasGieWtiJiGCSiWtSJOieQthereQeretQSrSTWHKPaGAsCStsWearSWeeBtr emitFSJtheKaGAaWHaPSWYSWeWeartheStherthesGaPesQereeBGeeHiWYPFharHaWHYPSssFQitha PPtheaCCearaWGeSJKTrWisheHYSPHtheQeiYhtSJtheiWseGtQasOerFremarAaKPeaWHtaAiWYaPP thiWYsiWtSGSWsiHeratiSWiGSTPHharHPFKPameNTCiterJSrhisSCiWiSWresCeGtiWYit http://wp.me/P29YQz-k
Penjahat #2 melakukan penyadapan kemudian Mempelajari ciphertext dari PIN baru tersebut Chosen-Plaintext Attack example PIN di-enkripsi lalu dikirimkan ke bank cipher(key,PIN) Penjahat #1 merubah PIN yang dimilikinya (chosen plaintext) … diulangi untuk beberapa nilai PIN 18 http://wp.me/P29YQz-k
Polyalphabetic encryption The Alberti cipher by Leon Battista Alberti around 1467 was believed to be the first polyalphabetic cipher But at 750 AD , Abu Yusuf Yaqub ibn Is-haq Al-Kindi, authored a book on cryptology the "Risalah fi Istikhraj al-Mu'amma" (Manuscript for the Deciphering Cryptographic Messages) Leon Battista Alberti Abu Yusuf Yaqub ibn Is-haq Al-Kindi http://wp.me/P29YQz-k
n monoalphabetic cyphers, M1,M2,…,Mn • Cycling pattern: • e.g., n=4, M1,M3,M4,M3,M2; M1,M3,M4,M3,M2; • For each new plaintext symbol, use subsequent monoalphabetic pattern in cyclic pattern • dog: d from M1, o from M3, g from M4 • Key: the n ciphers and the cyclic pattern http://wp.me/P29YQz-k
How this Cipher Works? Pick a keyword (for our example, the keyword will be "MEC"). Write your keyword across the top of the text you want to encipher, repeating it as many times as necessary. For each letter, look at the letter of the keyword above it (if it was 'M', then you would go to the row that starts with an 'M'), and find that row in the Vigenere table. Then find the column of your plaintext letter (for example, 'w', so the twenty-third column) Finally, trace down that column until you reach the row you found before and write down the letter in the cell where they intersect (in this case, you find an 'I' there). http://wp.me/P29YQz-k
Symmetric: Stream Ciphers • Combine each byte of keystream with byte of plaintext to get b of ciphertext • p(i) = ithunit of message • ks(i) = ithunit of keystream • c(i) = ithunit of ciphertext • c(i) = ks(i) ⊕ p(i) • (⊕ = exclusive or) • p(i) = ks(i) ⊕ c(i) http://wp.me/P29YQz-k
Problems with stream ciphers • Known plain-text attack • There’s often predictable and repetitive data in communication messages • attacker receives some cipher text c and correctly guesses corresponding plaintext m • ks = m ⊕ c • Attacker now observes c’ • m’ = (m ⊕ c) ⊕ c’ http://wp.me/P29YQz-k
Even easier • Attacker obtains two ciphertexts, c and c’, generating with same key sequence • c ⊕ c’ = m ⊕ m’ • There are well known methods for decrypting 2 plaintexts given their XOR http://wp.me/P29YQz-k
Integrity problem too • supppose attacker knows m and c; • want to change m to m’ • c’ = c ⊕ (m ⊕ m’) • send c’ to destination http://wp.me/P29YQz-k
Example of stream cipher: • A5 (for GSM) • RC4 http://wp.me/P29YQz-k
Symmetric encryption: block ciphers Message to be encrypted is processed in blocks of bytes (8 or 16). Block cipher: huge lookup table Example: 2-bit blocks and 2-bit keys http://wp.me/P29YQz-k
Each column should be a random permutation of all possible output strings • If block is 64 bits and key is 56 bits, have 264 rows, 256 columns, 2120 entries • Table too big: instead use function that simulates a randomly permuted table • c(i) = KAB(m(i)) : encrypt block m(i) using key AB • m(i) = KAB(c(i)) : decrypt block c(i) using key AB • Problem: if m(i) and m(j) same, c(i) and c(j) same • Attacker may be able to guess m(i) from context of message http://wp.me/P29YQz-k
Block ciphers: cipher block chaining • Don’t want same plaintext giving same ciphertext • Have encryption of current block depend on result of previous block • c(i) = KAB( m(i) ⊕ c(i-1) ) • m(i) = KAB( c(i) ⊕ c(i-1) ) • How do we encrypt first block? • Initialization vector (IV): random block = c(0) • IVs do not have to be secret http://wp.me/P29YQz-k
Symmetric key crypto: DES • DES: Data Encryption Standard • US encryption standard [NIST 1993] • 56-bit symmetric key, 64-bit plaintext input • Block cipher with cipher block chaining • How secure is DES? • DES Challenge: 56-bit-key-encrypted phrase decrypted (brute force) in less than a day • No known good analytic attack • making DES more secure: • 3DES: encrypt 3 times with 3 different keys (actually encrypt, decrypt, encrypt) http://wp.me/P29YQz-k
DES operation initial permutation 16 identical “rounds” of function application, each using different 48 bits of key final permutation http://wp.me/P29YQz-k
AES: Advanced Encryption Standard New (Nov. 2001) symmetric-key NIST standard, replacing DES processes data in 128 bit blocks 128, 192, or 256 bit keys brute force decryption (try each key) taking 1 sec on DES, takes 149 trillion years for AES http://wp.me/P29YQz-k
Key Distribution Center (KDC) http://wp.me/P29YQz-k
Alice, Bob need shared symmetric key. KDC: server shares different secret key with each registered user (many users) Alice, Bob know own symmetric keys, KA-KDC KB-KDC , for communicating with KDC. http://wp.me/P29YQz-k
Q: How does KDC allow Bob, Alice to determine shared symmetric secret key to communicate with each other? http://wp.me/P29YQz-k
Public Key Cryptography • symmetric key crypto • requires sender, receiver know shared secret key • Q: how to agree on key in first place (particularly if never “met”)? • public key cryptography • radically different approach [Diffie-Hellman76, RSA78] • sender, receiver do not share secret key • public encryption key known to all • private decryption key known only to receiver http://wp.me/P29YQz-k
Public key encryption algorithms http://wp.me/P29YQz-k
RSA: Choosing keys http://wp.me/P29YQz-k
RSA: Encryption, decryption http://wp.me/P29YQz-k
RSA example http://wp.me/P29YQz-k
RSA: another important property http://wp.me/P29YQz-k
RSA is slow • Exponentiation is computationally intensive • DES is at least 100 times faster than RSA • Session key, KS • Bob and Alice use RSA to exchange a symmetric key KS • Once both have KS, they use DES http://wp.me/P29YQz-k
Message Authentication • Allows communicating parties to verify that received messages are authentic. • Verify content of message has not been altered • Source is authentic • Message has not been artificially delayed (playback attack) • Sequence of messages is maintained http://wp.me/P29YQz-k
Why not use encryption? • Often overkill, computationally expensive • Broadcast message • Let’s first talk about message digests http://wp.me/P29YQz-k
Message Digests Function H( ) that takes as input an arbitrary length message and outputs a fixed-length strength: “message signature” Note that H( ) is a many to-1 function H( ) is often called a “hash function” http://wp.me/P29YQz-k
Desirable properties: • Easy to calculate • Irreversibility: Can’t determine m from H(m) • Collision resistance: Computationally difficult to produce m and m’ such that H(m) = H(m’) • Seemingly random output http://wp.me/P29YQz-k
Hash Function Algorithms • MD5 hash function widely used (RFC 1321) • 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 http://wp.me/P29YQz-k
Message Authentication Code (MAC) http://wp.me/P29YQz-k
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 http://wp.me/P29YQz-k