Lecture Notes. Advanced Discrete Structures COT S

Similar documents
Lecture Notes. Advanced Discrete Structures COT S

Jay Daigle Occidental College Math 401: Cryptology

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

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

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Topics. Probability Theory. Perfect Secrecy. Information Theory

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

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

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

Chapter 2 : Perfectly-Secret Encryption

Pseudo-random Number Generation. Qiuliang Tang

MATH3302 Cryptography Problem Set 2

Codes and Cryptography. Jorge L. Villar. MAMME, Fall 2015 PART XII

5. Classical Cryptographic Techniques from modular arithmetic perspective

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

Private-key Systems. Block ciphers. Stream ciphers

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

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

Classical Cryptography

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

Modern symmetric encryption

Pseudo-Random Generators

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

Pseudo-Random Generators

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

ENEE 459-C Computer Security. Message authentication (continue from previous lecture)

Topics. Pseudo-Random Generators. Pseudo-Random Numbers. Truly Random Numbers

Cryptography 2017 Lecture 2

A block cipher enciphers each block with the same key.

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

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

Solutions to the Midterm Test (March 5, 2011)

All-Or-Nothing Transforms Using Quasigroups

Implementation Tutorial on RSA

Data and information security: 2. Classical cryptography

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

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

Public-key Cryptography: Theory and Practice

6.080/6.089 GITCS April 8, Lecture 15

RSA RSA public key cryptosystem

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013

Circuit Complexity. Circuit complexity is based on boolean circuits instead of Turing machines.

Cryptography: The Landscape, Fundamental Primitives, and Security. David Brumley Carnegie Mellon University

Akelarre. Akelarre 1

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 2 Basics

Historical cryptography. cryptography encryption main applications: military and diplomacy

Chapter 2 Classical Cryptosystems

Problem 1. k zero bits. n bits. Block Cipher. Block Cipher. Block Cipher. Block Cipher. removed

Modified Hill Cipher for a Large Block of Plaintext with Interlacing and Iteration

5199/IOC5063 Theory of Cryptology, 2014 Fall

Block Ciphers and Feistel cipher

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

Lecture Note 3 Date:

Leftovers from Lecture 3

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

Introduction to Cybersecurity Cryptography (Part 5)

CSCI3381-Cryptography

Introduction to Cryptography. Lecture 8

Permutation Generators Based on Unbalanced Feistel Network: Analysis of the Conditions of Pseudorandomness 1

2.4 The Autokey cipher and cribs

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

3F1: Signals and Systems INFORMATION THEORY Examples Paper Solutions

Lecture 7: ElGamal and Discrete Logarithms

Introduction. CSC/ECE 574 Computer and Network Security. Outline. Introductory Remarks Feistel Cipher DES AES

Background: Lattices and the Learning-with-Errors problem

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

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

Lecture 1: Introduction to Public key cryptography

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

Lecture 1: Perfect Secrecy and Statistical Authentication. 2 Introduction - Historical vs Modern Cryptography

CPSC 467b: Cryptography and Computer Security

Cryptographic Engineering

Cryptography and Number Theory

STREAM CIPHER. Chapter - 3

Solution to Midterm Examination

Public Key Cryptography

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

A Large Block Cipher using an Iterative Method and the Modular Arithmetic Inverse of a key Matrix

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

ORYX. ORYX not an acronym, but upper case Designed for use with cell phones. Standard developed by. Cipher design process not open

Great Theoretical Ideas in Computer Science

Dan Boneh. Stream ciphers. The One Time Pad

CHAPTER 12 CRYPTOGRAPHY OF A GRAY LEVEL IMAGE USING A MODIFIED HILL CIPHER

Module 2 Advanced Symmetric Ciphers

Cryptography. pieces from work by Gordon Royle

Lecture 8 - Cryptography and Information Theory

CPSC 467: Cryptography and Computer Security

Public Key Cryptography

Attacks on RSA & Using Asymmetric Crypto

Number theory (Chapter 4)

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

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.

Simple Codes MTH 440

Network Security Based on Quantum Cryptography Multi-qubit Hadamard Matrices

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

Secret Sharing Schemes

Modern Cryptography Lecture 4

9 Knapsack Cryptography

Introduction to Modern Cryptography. Benny Chor

Cryptography Lecture 4 Block ciphers, DES, breaking DES

Transcription:

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

Recap ADFGX Cipher Block Cipher Modes of Operation Hill Cipher Inverting a Matrix (mod n)

Encryption: Hill Cipher Example 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

Hill Cipher Example Using the Gauss-Jordan elimination method: 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: Hill Cipher Example 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

Classical Cryptosystems - Section 2.7 BLOCK CIPHERS

Ciphertext only: Hill Cipher Attacks Changing one letter of the plaintext usually changes whole block If block sizes are small (<4), the little is changed and frequency analysis can be run on the whole blocks Easy to break with: Known plaintext Chosen plaintext Chosen ciphertext

Hill Cipher - Known Plaintext Plaintext: Ciphertext: d o n t b e e v i l 3 14 13 19 1 4 4 21 8 11 B J E Z X T N I B G 1 9 4 25 23 19 13 8 1 6 Try various block sizes: For n = 2, and so 3 14 13 19 3 14 13 19 α β γ δ 9 18 13 11 α β γ δ 1 9 4 25 1 9 18 13 11 (mod 26) (mod 26) 1 9 4 25 3 11 5 2 (mod 26)

Hill Cipher - Known Plaintext If the plaintext matrix does not have an inverse, try a different set of plaintext blocks Recall that matrix M is invertible if det M 0 (mod 26). If none of the plaintext matrices are invertible, try a different block size.

Hill Cipher Chosen Plaintext 1. Try out different possibilities for n until you find the right one 2. Encrypt the following plaintext: 1 st Block: baaaa a = 10000 0 2 nd Block: abaaa a = 01000 0 n th Block: aaaaa b = 00000 1 3. Encryption matrix is the output

Hill Cipher Chosen Plaintext For n = 2, 1 0 0 1 α β γ δ α β γ δ (mod 26) Invert the encryption matrix to find the decryption matrix.

Hill Cipher Chosen Ciphertext Similar to chosen plaintext Guess and check the key size Choose to decrypt the identity matrix α γ β δ 1 α β γ δ 1 0 0 1 (mod 26) Result is the decryption matrix Invert to find encryption matrix

Confusion and Diffusion Claude Shannon: Communication Theory of Secrecy Systems (1949) Confusion: Each letter of the cipher should depend on multiple parts of the key Diffusion: Changing a letter of the plaintext should change multiple letters of the ciphertext Diffusion causes error-propogation

Classical Cryptosystems - Section 2.8 BINARY NUMBERS AND ASCII

Example: (Base 10) Base Systems 2,345 10 = 2 10 3 + 3 10 2 + 4 10 1 + 5 10 0 Example: (Base 2 or Binary) 1,101 2 = 1 2 3 + 1 2 2 + 0 2 1 + 1 2 0 = 8 + 4 + 1 = 13 10

Binary Binary number: a string of 0 s and 1 s Each 0 or 1 is called a bit A representation that takes 8 bits is called an 8-bit number or a byte The largest number a byte can represent is 11111111 2 = 2 8 1 = 255

ASCII American Standard Code for Information Interchange A standard way to represent common alphabet characters Each character is represented using 7 bits Extra bit in the byte used for a parity check (to see if an error occurred in transmission)

ASCII Symbol! # $ % & Decimal 33 34 35 36 37 38 39 Binary 0100001 0100010 0100011 0100100 0100101 0100110 0100111 ( ) * +, -. / 40 41 42 43 44 45 46 47 0101000 0101001 0101010 0101011 0101100 0101101 0101110 0101111 0 1 2 3 4 5 6 7 48 49 50 51 52 53 54 55 0110000 0110001 0110010 0110011 0110100 0110101 0110110 0110111 8 9 : ; < = >? 56 57 58 59 60 61 62 63 0111000 0111001 0111010 0111011 0111100 0111101 0111110 0111111 @ A B C D E F G 64 65 66 67 68 69 70 71 1000000 1000001 1000010 1000011 1000100 1000101 1000110 1000111

ASCII Each message can be coded in binary: Message: Yes! Binary: Y e s! 1011001 1100101 1110011 1000001

Classical Cryptosystems - Section 2.9 ONE-TIME PADS

One-Time Pad (1918) An unbreakable cryptosystem Developed by Gilbert Vernam and Joseph Mauborgne Reported that during the Cold War the hot line between Washington, D.C., and Moscow used one-time pads

One-Time Pad Encryption: Code the message in binary Choose a binary key as long as the message Ciphertext is XOR between message and key p q p XOR q 0 0 0 0 1 1 1 0 1 1 1 0

One-Time Pad Example (Encryption) plaintext: 0101011100101110 (mod 2) key: + 1110001110001110 (mod 2) ciphertext: 1011010010100000 (mod 2)

Example (Decryption) One-Time Pad ciphertext: 1011010010100000 (mod 2) key: + 1110001110001110 (mod 2) plaintext: 0101011100101110 (mod 2)

Example (Decryption) One-Time Pad ciphertext: 1011010010100000 (mod 2) key: + 1110001110001110 (mod 2) plaintext: 0101011100101110 (mod 2)

One-Time Pad The Good: Brute force and frequency attacks do not work All that can be gained from the ciphertext is the message and key length Knowing part of the key doesn t give any information about the rest of the key The Bad: Knowing the key Knowing the plaintext Key can only be used once (otherwise can attack with cribdragging)

Key Generation A random key is desirable over a phrase Knowledge of part of a key gives no knowledge of the rest of the key The seed for a random key may be small, but can generate a longer pseudo-random string

Classical Cryptosystems - Section 2.10 PSEUDO-RANDOM BIT GENERATION

Hardware Random Number Generators Sampling from a natural process may not be sufficiently random may take too long/expensive to sample observable to others Examples Thermal noise Radiation / Photoelectric effect Quantum states

Pseudo-Random Bit Generation For many purposes a computer algorithm can generate pseudo-random bits Initial input called the seed and produces output bitstream Example: C library contains rand() function, which is a linear congruential generator produces a sequence of numbers x 1, x 2, such that x n ax n 1 + b mod m from a seed x 0 and parameters a, b, and m.

Pseudo-Random Bit Generation Any polynomial congruence generator is insecure Can be predicted even when parameters a, b, m are unknown One-way functions: Easy to compute in one direction and hard to find the inverse Digital Encryption Standard (DES) Secure Hash Algorithm (SHA) SSL is based on SHA

Blum-Blum-Shub (BBS) 1. Generate two large primes: p, q 3 (mod 4) 2. Let: n = pq 3. Choose a large x relatively prime to n. 4. Set: x 0 x 2 (mod n) 5. Let: x j x j 1 2 (mod n) for j = 1,2, 6. Let b j be the parity of the last bit of x j.

Blum-Blum-Shub (BBS) Example: Choose p, q 3 (mod 4): p = 134095639079, q = 3435316544843 n = pq = 460660967519384246719597 Choose x relatively prime to n: x = 151984354862728938426826

Blum-Blum-Shub (BBS) x 0 x 2 mod n 224896429303392756468086 (mod n) x 1 x 0 2 mod n 276799756549439688565582 (mod n) x 2 x 1 2 mod n 389970735289039492719843 (mod n) x 3 x 2 2 mod n 239541338864411504485899 (mod n)

Blum-Blum-Shub (BBS) b 0 = 6 0 (mod 2) b 1 = 2 0 (mod 2) b 2 = 3 1 (mod 2) b 3 = 9 1 (mod 2) Or can take several bits (k log 2 log 2 n) from each x i : b 0 = 086 000, b 1 = 582 100,