Introduction to Ciphers Breno de Medeiros. Cipher types From “Cipher”, Wikipedia article.

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Cryptography encryption authentication digital signatures
Cryptology Terminology and Early History. Cryptology Terms Cryptology –The science of concealing the meaning of messages and the discovery of the meaning.
Cryptology  Terminology  plaintext - text that is not encrypted.  ciphertext - the output of the encryption process.  key - the information required.
Creating Secret Messages. 2 Why do we need to keep things secret? Historically, secret messages were used in wars and battles For example, the Enigma.
Cryptography Cryptography: art or science of keeping messages secret Cryptology: branch of mathematics that studies the mathematical foundations of cryptographic.
CSE331: Introduction to Networks and Security Lecture 17 Fall 2002.
Cryptanalysis of the Playfair Cipher Using an Evolutionary Algorithm By: Benjamin Rhew.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Computer Security CS 426 Lecture 3
Section 2.9 The Hill Cipher; Matrices
Classical Encryption Techniques
L1.1. An Introduction to Classical Cryptosystems Rocky K. C. Chang, February 2013.
Chapter 2 – Classical Encryption Techniques
3.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3 Traditional Symmetric-Key Ciphers.
Classical Monoalphabetic Ciphers Day 2. Keyword cipher Select a keyword, if the keyword has any repeated letters, drop all but the first occurrence. Write.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
Diffusion and Confusion Two properties that a good cryptosystem should have: Diffusion: change of one character in the plaintext results in several characters.
Confusion and Diffusion1 Ref: William Stallings, Cryptography and Network Security, 3rd Edition, Prentice Hall, 2003.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Section 2.1: Shift Ciphers and Modular Arithmetic The purpose of this section is to learn about modular arithmetic, which is one of the fundamental mathematical.
Systems of Equations as Matrices and Hill Cipher.
Lec. 5 : History of Cryptologic Research II
Topic 21 Cryptography CS 555 Topic 2: Evolution of Classical Cryptography CS555.
Cryptography and Network Security (CS435) Part Two (Classic Encryption Techniques)
Section 2.1: Shift Ciphers and Modular Arithmetic Practice HW from Barr Textbook (not to hand in) p.66 # 1, 2, 3-6, 9-12, 13, 15.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Classical Cryptography.
Midterm Review Cryptography & Network Security
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
Rather than just shifting the alphabet Could shuffle (jumble) the letters arbitrarily Each plaintext letter maps to a different random cipher text letter.
Symmetric-Key Cryptography
Module :MA3036NI Cryptography and Number Theory Lecture Week 3 Symmetric Encryption-2.
9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &
Cryptography Lecture 2: Classic Ciphers Piotr Faliszewski.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami.
Cryptography Part 1: Classical Ciphers Jerzy Wojdyło May 4, 2001.
© G. Dhillon, IS Department Virginia Commonwealth University Principles of IS Security Cryptography and Technical IS Security.
Classical Crypto By: Luong-Sorin VA, IMIT Dith Nimol, IMIT.
1 Cryptanalysis Four kinds of attacks (recall) The objective: determine the key ( Herckhoff principle ) Assumption: English plaintext text Basic techniques:
Part 9, Basic Cryptography 1. Introduction A cryptosystem is a tuple: ( M,K,C, E,D) where M is the set of plaintexts K the set of keys C the set of ciphertexts.
Traditional Symmetric-Key Ciphers
24-Nov-15Security Cryptography Cryptography is the science and art of transforming messages to make them secure and immune to attacks. It involves plaintext,
Introduction to Cryptography Lecture 8. Polyalphabetic Substitutions Definition: Let be different substitution ciphers. Then to encrypt the message apply.
Network Security Lecture 13 Presented by: Dr. Munam Ali Shah.
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Substitution Ciphers Reference –Matt Bishop, Computer Security, Addison Wesley, 2003.
1 Classical Encryption Techniques. 2 Symmetric cipher model –Cryptography –Cryptanalysis Substitution techniques –Caesar cipher –Monoalphabetic cipher.
@Yuan Xue CS 285 Network Security Block Cipher Principle Fall 2012 Yuan Xue.
@Yuan Xue CS 285 Network Security Cryptography Overview and Classical Encryption Algorithms Fall 2012 Yuan Xue.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 4. Traditional and Modern.
@Yuan Xue Quick Review.
CRYPTOGRAPHY G REEK WORD MEANING “ SECRET WRITING ”
Substitution Ciphers.
Chapter 2 Basic Encryption and Decryption
CH15 –Security & Crypto.
Asad Gondal Ali Haider Mansoor
Classical Polygraphic Ciphers
Cryptography and Network Security
Computer and Data Security 4th Class
CS4780 Cryptography and Information Security
Outline Some Basic Terminology Symmetric Encryption
Classical Cryptography
Confusion and Diffusion
Information Security IT423
Hill Cipher The Hill Cipher uses matrix multiplication to encrypt a message. First, you need to assign two numbers to each letter in the alphabet and also.
Symmetric Encryption or conventional / private-key / single-key
Florida State University
Presentation transcript:

Introduction to Ciphers Breno de Medeiros

Cipher types From “Cipher”, Wikipedia article.

Classical ciphers Keyword cipher –Choose a keyword. We will use “keyword”. If the keyword has repeated occurrences of one character, then drop secondary occurrences. For instance, the word “secret” gives keyword “secrt”. – Extend the keyword by all missing alphabet characters (in alphabetic order). Examples: k e y w o r d a b c f g h i j l m n p q s t u v x z s e c r t a b d f g h i j k l m n o p q u v w x y z

Keyword continued Substitute characters according to the rule: –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 –k e y w o r d a b c f g h i j l m n p q s t u v x z Encrypting “The magic words are squeamish ossifrage”: –themagicwordsaresqueamishossifrage –qaohkdbyujnwpknopmsokhbpajppbrnkdo

Mono-alphabetic ciphers A mono-alphabetic cipher operates by –Substituting one character for another –The same substitution is applied, irrespective of the character position in the plaintext The keyword cipher is an example of a mono- alphabetic cipher. The Caesar cipher is another example: –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 –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

Alphabet permutations The English alphabet has 26 characters. The number of different mono-alphabetic ciphers equals the number of different permutations of the alphabet –26!  e+26 –This number is 89 bits long (or about 11 bytes) Could one assume that, if the specific permutation is not known, that such ciphers are safe?

Exhaustive search times Figure from textbook: Stallings. Cryptography and Network Security

Cryptanalysis Unlike suggested by exhaustive search times, mono-alphabetic substitution ciphers are not hard to cryptanalyze (recover the key/plaintext) The reason is that a natural language message contains a lot of structure that is not present in a random string of characters: –Character frequency –Sequence of character frequency

English character frequency Figure from textbook: Stallings. Cryptography and Network Security

Multi-letter ciphers Multi-letter ciphers work by substituting a group of letters (2, 3 or more at a time) by another group of letters (usually the same length) –The Playfair cipher uses square diagrams to substitute digrams of the plaintext –The Hill Cipher uses matrix operations to substitute letter sequences, n at a time, where n is a parameter of the cipher.

Playfair cipher A Keyword is chosen without repeated characters, say we have chosen “Cryptoquiz” CRYPT OQUI/JZ ABDEF GHKLM NSVWX To encrypt, split the word into digrams. Use fill letter for repeated characters in the same digram (say ‘x’): Monkey  MO NK EY Collect  CO LX LE CT CO encrypts as ‘OA’ CT encrypts as ‘RC’ MO encrypts as ‘GZ’

Hill Cipher Takes n successive letters. Each letter of the English alphabet is assigned a value: –a = 0, b = 1, c = 2,..., y = 24, z = 25 A set of linear equations is used to define the encryption using modular arithmetic. Structure (3 characters at a time): –C 1 = K 1,1 P 1 + K 1,2 P 2 + K 1,3 P 3 mod 26 –C 2 = K 2,1 P 1 + K 2,2 P 2 + K 2,3 P 3 mod 26 –C 3 = K 3,1 P 1 + K 3,2 P 2 + K 3,3 P 3 mod 26

Example of Hill Cipher Plaintext = “paymoremoney” First 3 letters of plaintext = (p, a, y) = ( ) First 3 letters of ciphertext = (l, n, s) = ( ) 11 = 17 * * * 24 mod = 21 * * * 24 mod = 2 * * * 24 mod 26

Hill Cipher characteristics Using several characters at a time makes it difficult to collect statistics of ciphertext distribution –More ciphertext is required There is a large number of keys to chose from. –All the invertible matrices of dimension n  n, and entries in { 0, 1, 2,..., 25}.

How to decrypt? The receiver knows the key, and can solve the system of equations for unknowns P i : –C 1 = K 1,1 P 1 + K 1,2 P 2 + K 1,3 P 3 mod 26 –C 2 = K 2,1 P 1 + K 2,2 P 2 + K 2,3 P 3 mod 26 –C 3 = K 3,1 P 1 + K 3,2 P 2 + K 3,3 P 3 mod 26 This system has solutions iff the matrix K is invertible. Let M be its inverse. Then: –P 1 = M 1,1 C 1 + M 1,2 C 2 + M 1,3 C 3 mod 26 –P 2 = M 2,1 C 1 + M 2,2 C 2 + M 2,3 C 3 mod 26 –P 3 = M 3,1 C 1 + M 3,2 C 2 + M 3,3 C 3 mod 26

How to break the Hill Cipher? Suppose the cryptanalyst can find a bit of text that has been encrypted with the Hill Cipher: –A pair (P, C) is available of plaintext and corresponding ciphertext, of some length. Use several systems to solve for M (need about n 2 encrypted characters): –P 1 = M 1,1 C 1 + M 1,2 C 2 + M 1,3 C 3 mod 26 –P 2 = M 2,1 C 1 + M 2,2 C 2 + M 2,3 C 3 mod 26 –P 3 = M 3,1 C 1 + M 3,2 C 2 + M 3,3 C 3 mod 26 Here 9 characters (3 groups) are needed.

Example: Suppose “friday” = (5,17,8,3,0,24) encrypts to “pqcfku” = (15,16,2,5,10,20). It is known that the Hill Cipher is 2  2 matrix. –(5, 17) goes to (15, 16) and (8, 3) to (2, 5). Write the equations: –5 = M 1,1  15 + M 1,2  16 mod 26 –17 = M 2,1  15 + M 2,2  16 mod 26 –8 = M 1,1  2 + M 1,2  5 mod 26 –3 = M 2,1  2 + M 2,2  5 mod 26