What is Cryptography? by Amit Konar, Dept. of Math and CS, UMSL

Similar documents
Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Sol: First, calculate the number of integers which are relative prime with = (1 1 7 ) (1 1 3 ) = = 2268

Shift Cipher. For 0 i 25, the ith plaintext character is. E.g. k = 3

CODING AND CRYPTOLOGY III CRYPTOLOGY EXERCISES. The questions with a * are extension questions, and will not be included in the assignment.

Introduction to Cryptology. Lecture 2

Classical Cryptography

Security of Networks (12) Exercises

MONOALPHABETIC CIPHERS AND THEIR MATHEMATICS. CIS 400/628 Spring 2005 Introduction to Cryptography

University of Regina Department of Mathematics & Statistics Final Examination (April 21, 2009)

Introduction to Cryptography

COMPUTER SECURITY. Classical Crypto Symmetric cryptography Cæsar cipher Vigènere ciphers DES

Chapter 2 Classical Cryptosystems

Cryptography. P. Danziger. Transmit...Bob...

Lecture 8 - Cryptography and Information Theory

CSCI3381-Cryptography

Cryptography CS 555. Topic 2: Evolution of Classical Cryptography CS555. Topic 2 1

Week 7 An Application to Cryptography

5. Classical Cryptographic Techniques from modular arithmetic perspective

Simple Codes MTH 440

Cook-Levin Theorem. SAT is NP-complete

Polyalphabetic Ciphers

Data and information security: 2. Classical cryptography

CRYPTOGRAPHY AND NUMBER THEORY

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

The Vigenère cipher is a stronger version of the Caesar cipher The encryption key is a word/sentence/random text ( and )

Outline. Computer Science 418. Number of Keys in the Sum. More on Perfect Secrecy, One-Time Pad, Entropy. Mike Jacobson. Week 3

Written examination. Tuesday, August 18, 2015, 08:30 a.m.

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky. Lecture 4

Efficient Cryptanalysis of Homophonic Substitution Ciphers

Classical Cryptography CS461/ECE422

... Assignment 3 - Cryptography. Information & Communication Security (WS 2018/19) Abtin Shahkarami, M.Sc.

Public Key Cryptography

10 Modular Arithmetic and Cryptography

CPSC 467b: Cryptography and Computer Security

} has dimension = k rank A > 0 over F. For any vector b!

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

THE UNIVERSITY OF CALGARY FACULTY OF SCIENCE DEPARTMENT OF COMPUTER SCIENCE DEPARTMENT OF MATHEMATICS & STATISTICS MIDTERM EXAMINATION 1 FALL 2018

Classical Cryptography

MODULAR ARITHMETIC. Suppose I told you it was 10:00 a.m. What time is it 6 hours from now?

Cryptography: A Fairy Tale for Mathematicians and Starring Mathematicians!

Outline. CPSC 418/MATH 318 Introduction to Cryptography. Information Theory. Partial Information. Perfect Secrecy, One-Time Pad

NET 311D INFORMATION SECURITY

ECE 646 Lecture 5. Motivation: Mathematical Background: Modular Arithmetic. Public-key ciphers. RSA keys. RSA as a trap-door one-way function

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

MATH3302 Cryptography Problem Set 2

Exercise Sheet Cryptography 1, 2011

Using Matrices for Cryptography

Cryptanalysis. A walk through time. Arka Rai Choudhuri

PERFECT SECRECY AND ADVERSARIAL INDISTINGUISHABILITY

Jay Daigle Occidental College Math 401: Cryptology

Real scripts backgrounder 3 - Polyalphabetic encipherment - XOR as a cipher - RSA algorithm. David Morgan

MATH 158 FINAL EXAM 20 DECEMBER 2016

Introduction to Cryptography CS 355 Lecture 3

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used.

Lecture Notes. Advanced Discrete Structures COT S

CHAPTER 4 REDUCTION OF VARIABLE LENGTH KEY SEARCH TIME OF VIGENERE CIPHER USING FIREFLY ALGORITHM

CS March 17, 2009

Hidden Markov Models for Vigenère Cryptanalysis

monoalphabetic cryptanalysis Character Frequencies (English) Security in Computing Common English Digrams and Trigrams Chapter 2

Classical Cryptography

About Vigenere cipher modifications

History of Maths andx

Shannon s Theory of Secrecy Systems

Elliptic Curve Computations (1) View the graph and an elliptic curve Graph the elliptic curve y 2 = x 3 x over the real number field R.

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30

Cryptography and Number Theory

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

Cryptography - Session 2

Number theory (Chapter 4)

Math 1350 (FALL 2008) Prelim 1 (10/6/2008) 1. Solution. For the Atbash cipher for the Roman alphabet we have

Weaknesses in Hadamard Based Symmetric Key Encryption Schemes

Solution to Midterm Examination

CHAPTER 5 A BLOCK CIPHER INVOLVING A KEY APPLIED ON BOTH THE SIDES OF THE PLAINTEXT

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

2.1 Plaintext, encryption algorithm, secret key, ciphertext, decryption algorithm.

Lecture (04) Classical Encryption Techniques (III)

one approach to improve security was to encrypt multiple letters invented by Charles Wheatstone in 1854, but named after his

COMM1003. Information Theory. Dr. Wassim Alexan Spring Lecture 5

THE ZODIAC KILLER CIPHERS. 1. Background

Introduction to Cryptology Dr. Sugata Gangopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Roorkee

Univ.-Prof. Dr. rer. nat. Rudolf Mathar. Written Examination. Cryptography. Tuesday, August 29, 2017, 01:30 p.m.

Cryptography CS 555. Topic 24: Finding Prime Numbers, RSA

Computer Science A Cryptography and Data Security. Claude Crépeau

Classic Cryptography Tutorial. c Eli Biham - May 3, Classic Cryptography Tutorial (3)

Chaos and Cryptography

Solutions for week 1, Cryptography Course - TDA 352/DIT 250

An Introduction to Cryptography

Clock Arithmetic and Euclid s Algorithm

ASSIGNMENT Use mathematical induction to show that the sum of the cubes of three consecutive non-negative integers is divisible by 9.

Notes 10: Public-key cryptography

Homework 4 for Modular Arithmetic: The RSA Cipher

CHAPTER 10 A GENERALIZED PLAYFAIR CIPHER INVOLVING INTERTWINING, INTERWEAVING AND ITERATION

Innovation and Cryptoventures. Cryptology. Campbell R. Harvey. Duke University, NBER and Investment Strategy Advisor, Man Group, plc.

Cryptography. pieces from work by Gordon Royle

Chapter 2 : Perfectly-Secret Encryption

Lecture Note 3 Date:

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrovsky. Lecture 7

RSA RSA public key cryptosystem

Winter 2008 Introduction to Modern Cryptography Benny Chor and Rani Hod. Assignment #2

Lecture 11: Non-Interactive Zero-Knowledge II. 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian problem

Transcription:

What is Cryptography? by Amit Konar, Dept. of Math and CS, UMSL

Definition: Cryptosystem Cryptography means secret writing and it is the art of concealing meaning. A Cryptosystem is a 5-tuple(E, D,M,K,C), where M is the set of plain texts, K is the set of keys C is the set of ciphertexts, E: M x K C is the set of enciphering functions, and D: C x K M is the set of deciphering functions.

A Simple Cryptosystem Key: K Key: K Plain text: M Encryption: Decryption: E: M x K C D: C x K M M Cyphertext Example: M= A B; K=3; C= D E

Example: Caesar Cipher This cipher is a cryptosystem with M={all sequence of roman letters} = HELLO= [7 4 11 11 14 K={i an integer, such that 0<=i<=25}=3,say. E={E k k K and for all m M,E k (m) =(m +k) mod 26}= [10 mod 26, 7 mod 26.] D={D k k K and for all c C, D k (c )= (26+ck)mod26} = {(26+10-3) mod 26, }

Classical Cryptosystems Transposition Ciphers: HELLO WORLD changed to HLOOL ELWRD, resulting the ciphertex thloolelwrd. Substitution Ciphers: key: V IGVIG V IGVIGV I G plaintext: THEBOY HASTHEBAG Ciphertext: OPKWWE C IY OPK W I M

Goal of Cryptography 1. Ciphertext Only Attack: The adversary has only the ciphertext. Her goal is to find the corresponding plaintext. If possible, she may find the key too. 2. Plaintext Attack: The adversary has the ciphertext and the plaintext. Her goal was to find the key used. 3. Chosen Plaintext Attack: The adversary may ask that specific plaintexts be enciphered. She is given the corresponding ciphertexts. Her goal is to find the key that was used.

Models Used for Attack Attacks use both mathematics and statistics. The statistical methods make assumptions about the statistics of the plaintext language and examine the ciphertext to corelate the properties with those assumptions. These assumptions are collectively called models of the language.

n-gram Models N-gram models represent frequency of occurrence of n-consecutive letters in the English language. Example: 1-gram model describes frequency of occurrence of a character A, B, C etc. in the English language. Their selection is independent.

Table of character frequencies in the English language a 0.080 z 0.002 b 0.015 c 0.030 d 0.040 e 0.130 f 0.020

2-gram(digrams) models with he 0.0305 ho 0.0043 wh 0.0026 eh 0.0002 one character as h How to get these digram models? Paragraph: Hello! Does he know you?. Frequency of he: 2, freq. of other digrams: oe: 1, ou: 1, ow: 1, lo: 1. Normalized freq. of he= 2/(2+1+1+1)= 2/5.

How digrams can be used to retrieve plaintexts in transposition ciphers? Recall that a transposition cipher rearranges characters in the plaintext to form ciphertext. Characters are not changed. Example: Plaintext: HELLO WORLD Ciphertext: HLOOLELWRD Consult Konheim s digram table and note that freq(he) = 0.0305 > freq(ho) (=0.0043) > freq(hl) >freq(lh) etc. So, the first two leters of the plaintext may be HE. This is possible if we write HLOOL by HE ELWRD LL OW OR LD Reading the letters across and down produces HELLO WORLD.

How 1-grams can be used to retrieve plaintext in Substitution Ciphers Example: Caesar cipher is a substitution cipher. Given plaintexts: HELLO WORLD, and ciphertexts: KHOOR ZRUOG, key=3. Let (i)= 0<=c<=25 f(c) p(c i) be the co-relation of the freq. of each letter in the ciphertext with the character freq. in English. f(c )= freq. of a char. in the ciphertext; p(c-i)= prob. of occurrence of the i-position shifted character from c.

Main Steps to retrieve plaintexts in Substitution Ciphers Example (Contd.): Plaintexts: HELLO WORLD Key=3; Ciphertexts:KHOOR ZRUOG Freq. of letters in ciphertexts G 0.1 H 0.1 K 0.1 O 0.3 R 0.2 U 0.1 Z 0.1 (i)= 0<=c<=25 f(c) p(c i) = 0.1 p(6-i) + 0.1 p(7-i) + 0.1 p(10-i) + 0.3 p(14-i)+ 0.2 p(17-i) +0.1 p(25-i) Find 0<=i<=25 such that (i) is maximized.

Computing (i) for varying i Part of Table Showing Computed Results for (i).. (6) = 0.0660 (10)= 0.0635 (3) = 0.0575 (14)= 0.0535 Deciphered Plaintext EBIL TLOIA AXEEH PHKEW HELLO WORLD WTAAD LDGAS Ciphertexts: KHOOR ZRUOG Conclusion: i=3 as (i) for other i does not produce meaningful texts.

Vigenere Cipher Given a vignere table, how to encipher? Plaintext: A B E G H S T Y Key G G H K M N Y Z E I I J M O P V O Key: VIG VIG VIG VIG VIG Plaintest: THE BOY HAS THE BAG Ciphertext: OPK WWE CIY OPK WIM

Attacking Vigenere Cipher by Index of Coincidence What is index of Coincidence? The index of coincidence measures the differences in the frequencies of the letters in the ciphertexts. It is defined as the probability that two randomly chosen letters from the ciphertext will be the same.

Formal Definition of Index of Coincidence Let F c be the freq. of the cipher character c, N be the length of the ciphertext. Then index of Coincidence(IC) is given by 1 25 IC= -------- F c (F c -1) N(N-1) c=0

The lower the IC, the less the variation in the characters, and longer the period Period: gap between repeatations Table of IC Period: 1 2 3 Large Expected IC: 0.06 0.05 0.04 0.038 Hence, lower the IC, longer the period.

Main Steps: Guessing Plaintext from Ciphertext 1. List repetitive words (digrams, 3-grams etc.), determine their positions in the ciphertext and hence evaluate gap length. 2. Determine factors of gap length. (eg. If gap length is 10, factors are: 2, 5). 3. Determine the length of longest repetitive word. The key length should be equal or more than the longest repetitive word.

Main Steps (Contd.) 4. Identify the next longest repetitive n-gram, and note its gap length. 5. Determine the greatest common divisor (GCD) of the gap length for the first two longest n-grams. Guess this to be the length of the Key. 6. Divide the ciphertext into strings of 6 character, and write them row-wise.

Mian Steps: Retrieving Plaintexts 7. Suppose you obtain: A D Q Y S M I U S B O X K K T M I B. I U I X (contd.) Evaluate Column-wise Index of Coincidence for 6 alphabet sequence.

Retrieval of Plaintext (Contd.) 8. Check from Index of Coincidence values: whether period of the alphabet sequences are different. This can be performed by matching with the table of IC versus periods. If no, fine, else new period may be presumed.

Retrieval (Contd.) 9. Determine frequency of character in each alphabet. Column A B C D E F G H. Alpha#1 3 1 0 0 4 0 1 1 Alpha#2 1 0 0 2 2 2 1 0 Alpha#3 1 2 0 0 0 0 0 0 Alpha#4 Alpha#5 Alpha#6 Standard: H M M M H M M H.. 1. The first alphabet matches with standard. 2.Given the gap between B and I, the third alphabet seems to shifted with I mapping to A. 3. A similar gap occurs in the sixth alphabet between O and V, suggesting V maps to A. This makes three changes in every 6-lettered ciphertexts.

Add more heuristics to obtain final solution: plaintexts 1. In the last row one group of 3-characters is AJE, which should be replaced by ARE. 2. In English Q is always followed by U. 3. Now isolate words from the running string of characters using a standard English dictionary.