Lecture Notes. Advanced Discrete Structures COT S

Similar documents
Lecture Notes. Advanced Discrete Structures COT S

Chapter 2 Classical Cryptosystems

A block cipher enciphers each block with the same key.

Lecture 12: Block ciphers

Jay Daigle Occidental College Math 401: Cryptology

CPSC 467b: Cryptography and Computer Security

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

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

Cristina Nita-Rotaru. CS355: Cryptography. Lecture 9: Encryption modes. AES

Symmetric Ciphers. Mahalingam Ramkumar (Sections 3.2, 3.3, 3.7 and 6.5)

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

Classical Cryptography

5. Classical Cryptographic Techniques from modular arithmetic perspective

CSc 466/566. Computer Security. 5 : Cryptography Basics

Block ciphers. Block ciphers. Data Encryption Standard (DES) DES: encryption circuit

CSCI3381-Cryptography

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

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

Simple Codes MTH 440

Implementation Tutorial on RSA

The Hill Cipher A Linear Algebra Perspective

Lecture 4: DES and block ciphers

Outline. 1 Arithmetic on Bytes and 4-Byte Vectors. 2 The Rijndael Algorithm. 3 AES Key Schedule and Decryption. 4 Strengths and Weaknesses of Rijndael

Discrete Mathematics GCD, LCM, RSA Algorithm

Introduction to Modern Cryptography. Benny Chor

3F1: Signals and Systems INFORMATION THEORY Examples Paper Solutions

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

2.4 The Autokey cipher and cribs

Block ciphers And modes of operation. Table of contents

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.

MATH3302 Cryptography Problem Set 2

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

Data and information security: 2. Classical cryptography

1111: Linear Algebra I

MODULAR ARITHMETIC KEITH CONRAD

AN ENHANCED CRYPTOGRAPHIC SUBSTITUTION METHOD FOR INFORMATION SECURITY

Cristina Nita-Rotaru. CS355: Cryptography. Lecture 4: Enigma.

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

Symmetric Encryption

Introduction to Cryptology. Lecture 2

Solution to Midterm Examination

Security of Networks (12) Exercises

Lecture 8: Determinants I

Linear Algebra I Lecture 8

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

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

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

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

U.C. Berkeley CS276: Cryptography Luca Trevisan February 5, Notes for Lecture 6

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

INVERSE OF A MATRIX [2.2] 8-1

Introduction to Cryptography

1/16 2/17 3/17 4/7 5/10 6/14 7/19 % Please do not write in the spaces above.

Secret Key: stream ciphers & block ciphers

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

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

Public Key Cryptography

CSA E0 235: Cryptography March 16, (Extra) Lecture 3

Modern Cryptography Lecture 4

CS 6260 Applied Cryptography

Efficient Cryptanalysis of Homophonic Substitution Ciphers

Cryptography. pieces from work by Gordon Royle

CTR mode of operation

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

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

Cryptography. Lecture 2: Perfect Secrecy and its Limitations. Gil Segev

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

Symmetric Crypto Systems

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

Solutions to the Midterm Test (March 5, 2011)

Review for Exam Find all a for which the following linear system has no solutions, one solution, and infinitely many solutions.

Question 2.1. Show that. is non-negligible. 2. Since. is non-negligible so is μ n +

Number theory (Chapter 4)

Week 7 An Application to Cryptography

7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

Block Ciphers and Feistel cipher

Linear Ciphers. Klaus Pommerening Fachbereich Physik, Mathematik, Informatik der Johannes-Gutenberg-Universität Saarstraße 21 D Mainz

last name ID 1 c/cmaker/cbreaker 2012 exam version a 6 pages 3 hours 40 marks no electronic devices SHOW ALL WORK

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I

Lattice Reduction Attack on the Knapsack

Symmetric Crypto Systems

CPSC 467: Cryptography and Computer Security

Question: Total Points: Score:

Shannon s Theory of Secrecy Systems

Block vs. Stream cipher

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

AES side channel attacks protection using random isomorphisms

CRYPTOGRAPHY AND NUMBER THEORY

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Introduction to Cybersecurity Cryptography (Part 4)

Network Security Based on Quantum Cryptography Multi-qubit Hadamard Matrices

10 Modular Arithmetic and Cryptography

Product Systems, Substitution-Permutation Networks, and Linear and Differential Analysis

Cryptography: A Fairy Tale for Mathematicians and Starring Mathematicians!

SYMMETRIC ENCRYPTION. Mihir Bellare UCSD 1

About Vigenere cipher modifications

Lecture Notes, Week 6

Transcription:

Lecture Notes Advanced Discrete Structures COT 4115.001 S15 2015-01-22

Recap Two methods for attacking the Vigenère cipher Frequency analysis Dot Product Playfair Cipher

Classical Cryptosystems - Section 2.6 ADFGX CIPHER

ADFGX Cipher Invented by Colonel Fritz Nebel in 1918 Used by the German army on the Western front during World War I Successfully attacked by French cryptanalyst Georges Painvin ADFGX are easy to distinguish in Morse code: A: D: F: G: X: reducing transmission errors, an early attempt to combine encryption and error correction. ADFGX was eventually replaced by the ADFGVX cipher

Polybius square (~200BC) A Polybius square (or checkerboard) is a device used to fractionate plaintext characters so that they can be represented by a smaller set of symbols. Each letter is coded as its corresponding row and column symbol 1 2 3 4 5 1 a b c d e 2 f g h i/j k 3 l m n o p 4 q r s t u 5 v w x y z Example: peachykeen 35 15 11 13 23 54 25 15 15 33

ADFGX Cipher Encryption: 1. Code message using a random Polybius square with labels ADFGX: A D F G X A x g a d s D t i/j q e p F h c u r z G y f k m w X n b v o l Plaintext: Code: t h e k n i g h t s w h o s a y n i DAFADGGFXADDADFADAAXGXFAXGAXAFGAXADD

ADFGX Cipher Codetext: DAFADGGFXADDADFADAAXGXFAXGAXAFGAXADD 2. Choose a word as a Key and arrange the Codetext into blocks of whatever size the keyword is. Key: P Y T H O N D A F A D G G F X A D D A D F A D A A X G X F A X G A X A F G A X A D D

ADFGX Cipher 3. Sort columns according to the alphabetic order of the key word. P Y T H O N H N O P T Y D A F A D G A G D D F A G F X A D D A D D G X F A D F A D A A A D A F D A X G X F A X A F A G X X G A X A F X F A X A G G A X A D D A D D G X A 4. Cipher text is formed by read down the columns: ciphertext: AAAXXAGDAAFDDDDFADDGAAXGFXFGAXAFDXGA

ADFGX Cipher Decryption: Reverse the process. A D F G X A x g a d s D t i/j q e p F h c u r z G y f k m w X n b v o l key: yep ciphtertext: GFAXGDAAGDGDDAFXAXAX Figure out column lengths: ciphertext = 20 letters key = 3 letters 20 = 6 3 + 2 There will be 6 rows of three letters and one row of 2 letters, i.e., the p column will have one less letter.

ADFGX Cipher Ciphertext: key: Polybuis square: GFAXGDAAGDGDDAFXAXAX yep Place letters into columns: A D F G X A x g a d s D t i/j q e p F h c u r z E P Y Y E P G y f k m w G A A A G A F G F F F G X n b v o l A D X X A D Codetext: X G A A X G AGAFFGXADAXGXGDADDXA G D X X G D D D A A D D Plaintext: A X X A d a r n t o o t i n

Classical Cryptosystems - Section 2.7 BLOCK CIPHERS

Block Cipher Plaintext is grouped into blocks which are encrypted as a whole Typically, changing one letter changes the whole block Makes frequency analysis more difficult Examples: Playfair (blocks of size 2) DES (64 bit blocks) AES (128 bit blocks)

Block Cipher Mode of Operation Electronic Codebook Mode (ECB): Blocks are encoded individually one at a time Not recommended by anyone! (Wikipedia, Block cipher mode of operation)

Block Cipher Mode of Operation Cipher Block Chaining (CBC): Use information from the previously ciphered block to code the next block before encrypting (Wikipedia, Block cipher mode of operation)

Block Cipher Mode of Operation Cipher Feedback (CBF): Information from the previously ciphered block and the plaintext are used to code the next block before encrypting (Wikipedia, Block cipher mode of operation)

Block Cipher Mode of Operation Other Modes: Propagating cipher-block chaining (PCBC) Output feedback (OFB) Counter (CTR) (Wikipedia, Block cipher mode of operation)

Hill Cipher (1929) Invented by Lester Hill Never in widespread use Probably the first time algebra was used in an essential way Algebra is essential to most modern cryptographic systems

Hill Cipher 1. Pick n Z. Create an n n matrix with entries modulo 26. Example: n = 3 3 22 17 8 2 11 23 5 19 2. Split message into blocks of size n and encode as an integer-valued vectors: Example: seespotrunxx (18,4,4),(18,15,14),(19,17,20),(13,23,23)

Encryption: Hill Cipher Multiple coded vector by matrix (mod 26) Coded Vectors: 18,4,4, 18,15,14, 19,17,20, (13,23,23) 18 4 4 18 15 14 19 17 20 13 23 23 3 22 17 8 2 11 23 5 19 3 22 17 8 2 11 23 5 19 3 22 17 8 2 11 23 5 19 3 22 17 8 2 11 23 5 19 = 178 424 426 22 8 10 mod 26 = 496 496 737 2 2 9 mod 26 = 653 552 890 3 6 6 mod 26 = 752 447 911 24 5 1 mod 26 Encrypted Vectors: 22,8,10, 2,2,9, 3,6,6, (24,5,1) Ciphertext: C I K C C J D G G Y F B

Inverse of a Matrix (mod n) The inverse of the matrix M, notated M 1, is the matrix such that M M 1 I = 1 0 0 0 1 0 0 0 1 (mod n) For vectors v and w, if v M w mod n then v v I v M M 1 v M M 1 w M 1 (mod n)

Basic Number Theory - Section 3.8 INVERTING MATRICES MOD N

Inverse of a 2x2 Matrix For a, b, c, d R such that ad bc 0, if a b M = c d then M 1 = ad bc 1 d b. c a Check: ad bc 1 d b a b c a c d = 1 0 0 1

Inverse of a 2x2 Matrix (mod n) Similarly, ad bc 1 d b c a a b c d 1 0 0 1 (mod n) if ad bc 1 (mod n) exists, i.e., when gcd ad bc, n = 1. In fact, M 1 (mod n) exists if det M 0 (mod n).

Determinant of k k Matrix Expansion of Co-factors: det a b c d e f g h i j k l m n o p = a det f g h j k l n o p e det b c d j k l n o p + i det b c d f g h n o p

Determinant of k k Matrix Expansion of Co-factors: det 2 8 11 1 3 7 5 5 4 = 2 det 3 7 5 4 det 8 11 5 4 + 5 det 8 11 3 7 = 2 23 23 + 5 23 = 92

Inverse of a k k Matrix (mod n) Gauss-Jordan elimination method: Turn a b c d e f h i j 1 0 0 0 1 0 0 0 1 into 1 0 0 0 1 0 0 0 1 A B C D E F H I J using the rules: 1. Multiply a row by a constant r 1 c r 1 2. Swap two rows r 1 r 2, r 2 r 1 3. Replace a row with the sum of another row r 1 r 1 + r 2 Rules 1. and 3. can be combined to give r 1 c r 1 + d r 2

Inverse of a k k Matrix (mod n) Example: 7 3 5 6 1 0 0 1 r 1 7 1 r 1 1 19 5 6 15 0 0 1 (mod 26) 7 1 15 (mod 26) r 2 5 1 r 2 1 19 1 22 r 2 r 2 r 1 1 19 0 3 15 0 0 21 15 0 11 21 mod 26 5 1 21 (mod 26) (mod 26) r 2 3 1 r 2 1 19 0 1 r 1 r 1 19 r 2 1 0 0 1 15 0 21 7 (mod 26) 3 1 9 (mod 26) 6 23 21 7 (mod 26) Check: 7 3 5 6 6 23 21 7 105 182 = 156 157 1 0 0 1 (mod 26)

Hill Cipher Example Similarly, with a little work: 3 22 17 8 2 11 23 5 19 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 11 9 0 5 2 19 10 5 6 (mod 26) which means that if a b c 3 22 17 8 2 11 23 5 19 A B C (mod 26) then a b c A B C 11 9 0 5 2 19 10 5 6 (mod 26)

Decryption: Over the Hill Cipher Multiply the encrypted vectors by the inverse matrix: Encrypted Vectors: 22,8,10, 2,2,9, 3,6,6, (24,5,1) 22 8 10 2 2 9 3 6 6 24 5 1 11 9 0 5 2 19 10 5 6 11 9 0 5 2 19 10 5 6 11 9 0 5 2 19 10 5 6 11 9 0 5 2 19 10 5 6 18 4 4 mod 26 18 15 14 mod 26 19 17 20 mod 26 13 23 23 mod 26 Decrypted Vectors: 18,4,4, 18,15,14, 19,17,20, (13,23,23) Plaintext: S E E S P O T R U N X X