Outline More On Cryptography • Permutation ciphers CS 239 • Stream and block ciphers Computer Security • Uses of cryptography January 25, 2006 Lecture 5 Lecture 5 Page 1 Page 2 CS 239, Winter 2006 CS 239, Winter 2006 Characteristics of Permutation Permutation Ciphers Ciphers • Instead of substituting different • Doesn’t change the characters in the characters, scramble up the existing message characters –Just where they occur • Use algorithm based on the key to • Thus, character frequency analysis control how they’re scrambled doesn’t help cryptanalyst • Decryption uses key to unscramble Lecture 5 Lecture 5 Page 3 Page 4 CS 239, Winter 2006 CS 239, Winter 2006 Example of Columnar Columnar Transpositions Substitution • Write the message characters in a How did this transformation happen? series of columns T e 0 y n c T T r a n s f r a n s f T e 0 y n c r r r r g o r g o e r $ 1 0 e $ l 0 • Copy from top to bottom of first 0 0 t o m t o m a t s s u a t s s u n $ o a n column, then second, etc. y s a v i y s a v i n $ o a n s s 1 v a t v a t n g s a c n g s a c l c o u f 0 m i c f 0 m i c c o u n t n t Looks a lot more cryptic written this way: Te0yncrr goa tssun$oans1 vatf0mic Lecture 5 Lecture 5 Page 5 Page 6 CS 239, Winter 2006 CS 239, Winter 2006 1
Attacking Columnar For Example, Transformations • The trick is figuring out how many • In our case, the presence of numerals columns were used in the text is suspicious • Use information about digrams, –One might guess the numerals trigrams, and other patterns belong together • Digrams are letters that frequently –And maybe the dollar sign with them occur together (re, th, en, for example) • Most of this analysis is more • For each possibility, check digram complicated frequency Lecture 5 Lecture 5 Page 7 Page 8 CS 239, Winter 2006 CS 239, Winter 2006 Double Transpositions Generalized Transpositions • Do it twice • Any algorithm can be used to scramble • Using different numbers of columns the text each time • Usually somehow controlled by a key • Find pairs of letters that probably • Generality of possible transpositions appeared together in the plaintext makes cryptanalysis harder • Figure out what transformations would put them in their positions in the ciphertext Lecture 5 Lecture 5 Page 9 Page 10 CS 239, Winter 2006 CS 239, Winter 2006 Which Is Better, Transposition or Stream and Block Ciphers Substitution? • Well, neither, really • Stream ciphers convert one symbol of • Strong modern ciphers tend to use both plaintext immediately into one symbol of ciphertext • Transposition scrambles text patterns • Substitution hides underlying text • Block ciphers work on a given sized characters/bits chunk of data at a time • Combining them can achieve both effects – If you do it right . . . Lecture 5 Lecture 5 Page 11 Page 12 CS 239, Winter 2006 CS 239, Winter 2006 2
Stream Ciphers Advantages of Stream Ciphers Key + Speed of encryption and decryption • Each symbol encrypted as soon as it’s available + Low error propagation fsna fsn f e fsnarT fs m n a r fsnar f q z S r T s S qS ermzqS rmzqS mzqS zqS • Errors affect only the symbol where the error occurred Plaintext Ciphertext Encryption Lecture 5 Lecture 5 Page 13 Page 14 CS 239, Winter 2006 CS 239, Winter 2006 Disadvantages of Stream Ciphers Block Ciphers Key – Low diffusion T r a n T s r • Each symbol separately encrypted s f e r f $ a e • Each ciphertext symbol only contains $ 1 0 1 n r 0 information about one plaintext symbol T s r T r a n – Susceptible to insertions and modifications f $ a e s f e r – Not good match for many common uses of 1 n r 0 $ 1 0 cryptography Plaintext Ciphertext Encryption Lecture 5 Lecture 5 Page 15 Page 16 CS 239, Winter 2006 CS 239, Winter 2006 Advantages of Block Ciphers Disadvantages of Block Ciphers + Diffusion – Slower • Easier to make a set of encrypted • Need to wait for block of data before characters depend on each other encryption/decryption starts + Immunity to insertions – Worse error propagation • Encrypted text arrives in known • Errors affect entire blocks lengths Lecture 5 Lecture 5 Page 17 Page 18 CS 239, Winter 2006 CS 239, Winter 2006 3
Desirable Characteristics of Ciphers More Characteristics • Well matched to requirements of • Simplicity of implementation application –Seemingly more important for hand –Amount of secrecy required should ciphering match labor to achieve it –But relates to probability of errors in • Freedom from complexity computer implementations –The more complex algorithms or key • Errors should not propagate choices are, the worse Lecture 5 Lecture 5 Page 19 Page 20 CS 239, Winter 2006 CS 239, Winter 2006 Yet More Characteristics Uses of Cryptography • Ciphertext size should be same as • What can we use cryptography for? plaintext size • Lots of things • Encryption should maximize confusion –Secrecy –Relation between plaintext and –Authentication ciphertext should be complex –Prevention of alteration • Encryption should maximize diffusion –Plaintext information should be distributed throughout ciphertext Lecture 5 Lecture 5 Page 21 Page 22 CS 239, Winter 2006 CS 239, Winter 2006 Cryptography and Secrecy Cryptography and Authentication • How can I prove to you that I created a • Pretty obvious piece of data? • Only those knowing the proper keys • What if I give you the data in encrypted can decrypt the message form? –Thus preserving secrecy – Using a key only you and I know • Then only you or I could have created it • Used cleverly, it can provide other – Unless one of us told someone else the forms of secrecy key . . . Lecture 5 Lecture 5 Page 23 Page 24 CS 239, Winter 2006 CS 239, Winter 2006 4
Some Limitations on Cryptography and Non- Cryptography and Authentication Alterability • If both parties cooperative, cryptography • Changing one bit of an encrypted message can authenticate completely garbles it – Problems with non-repudiation, though – For many forms of cryptography • What if three parties want to share a key? • If a checksum is part of encrypted data, that’s detectable – No longer certain who created anything • If you don’t need secrecy, can get the same – Public key cryptography can solve this effect problem – By just encrypting the checksum • What if I want to prove authenticity without secrecy? Lecture 5 Lecture 5 Page 25 Page 26 CS 239, Winter 2006 CS 239, Winter 2006 Cryptography and Zero- Knowledge Proofs • With really clever use, cryptography can be used to prove I know a secret –Without telling you the secret • Seems like magic, but it can work • Basically, using multiple levels of cryptography in very clever ways Lecture 5 Page 27 CS 239, Winter 2006 5
Recommend
More recommend