L2. An Introduction to Classical Cryptosystems. Rocky K. C. Chang, 23 January 2015

Similar documents
Cryptosystems. Truong Tuan Anh CSE-HCMUT

Traditional Symmetric-Key Ciphers. A Biswas, IT, BESU Shibpur

Chapter 3 Traditional Symmetric-Key Ciphers 3.1

Classical Cryptography

Classical Encryption Techniques. CSS 322 Security and Cryptography

Java Applets for a Cryptology Course. Ulrich A. Hoensch Rocky Mountain College Billings, Montana

CRYPTOLOGY KEY MANAGEMENT CRYPTOGRAPHY CRYPTANALYSIS. Cryptanalytic. Brute-Force. Ciphertext-only Known-plaintext Chosen-plaintext Chosen-ciphertext

Study Guide to Mideterm Exam

Channel Coding and Cryptography Part II: Introduction to Cryptography

Lecture 2. Cryptography: History + Simple Encryption,Methods & Preliminaries. Cryptography can be used at different levels

UNIT - II Traditional Symmetric-Key Ciphers. Cryptography & Network Security - Behrouz A. Forouzan

Behrang Noohi. 22 July Behrang Noohi (QMUL) 1 / 18

2/7/2013. CS 472 Network and System Security. Mohammad Almalag Lecture 2 January 22, Introduction To Cryptography

OVE EDFORS ELECTRICAL AND INFORMATION TECHNOLOGY

Cryptography. Submitted to:- Ms Poonam Sharma Faculty, ABS,Manesar. Submitted by:- Hardeep Gaurav Jain

Cryptography and Network Security 2. Symmetric Ciphers. Lectured by Nguyễn Đức Thái

Module 13 Network Security. Version 1 ECE, IIT Kharagpur

Cryptography and Network Security

Cryptography Introduction to Computer Security. Chapter 8

A Tour of Classical and Modern Cryptography

EE 595 (PMP) Introduction to Security and Privacy Homework 1 Solutions

Exploring Cryptography Using CrypTool

Math236 Discrete Maths with Applications

Cryptography and Network Security

CPSC 467b: Cryptography and Computer Security

Introduction to Cryptography. Lecture 1. Benny Pinkas. Administrative Details. Bibliography. In the Library

Introduction to Cryptography. Lecture 1

Computer Security. 08r. Pre-exam 2 Last-minute Review Cryptography. Paul Krzyzanowski. Rutgers University. Spring 2018

CSC 580 Cryptography and Computer Security

ICT 6541 Applied Cryptography. Hossen Asiful Mustafa

Classical Encryption Techniques

10/3/2017. Cryptography and Network Security. Sixth Edition by William Stallings

EEC-484/584 Computer Networks

Overview of Conventional Encryption Techniques

Public Key Cryptography

Classical Cryptography. Thierry Sans

Some Stuff About Crypto

CSCI 454/554 Computer and Network Security. Topic 2. Introduction to Cryptography

Outline Basics of Data Encryption CS 239 Computer Security January 24, 2005

Cryptography BITS F463 S.K. Sahay

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

Cryptography Symmetric Encryption Class 2

Lecture IV : Cryptography, Fundamentals

Classic Cryptography: From Caesar to the Hot Line

Basic Concepts and Definitions. CSC/ECE 574 Computer and Network Security. Outline

L3. An Introduction to Block Ciphers. Rocky K. C. Chang, 29 January 2015

CSC 474/574 Information Systems Security

T H E U N I V E R S I T Y O F B R I T I S H C O L U M B I A. Introduction to Cryptography

Introduction to Cryptography CS 136 Computer Security Peter Reiher October 9, 2014

Chapter 2: Classical Encryption Techniques

CSCE 813 Internet Security Symmetric Cryptography

Cryptography Symmetric Cryptography Asymmetric Cryptography Internet Communication. Telling Secrets. Secret Writing Through the Ages.

Lecture 2 Algorithms with numbers

Security Analysis and Modification of Classical Encryption Scheme

Outline. Cryptography. Encryption/Decryption. Basic Concepts and Definitions. Cryptography vs. Steganography. Cryptography: the art of secret writing

Cryptography Worksheet

Module 1: Classical Symmetric Ciphers

Cryptographic Techniques. Information Technologies for IPR Protections 2003/11/12 R107, CSIE Building

Sankalchand Patel College of Engineering, Visnagar B.E. Semester V (CE/IT) INFORMATION SECURITY Practical List

Computer Security. 08. Cryptography Part II. Paul Krzyzanowski. Rutgers University. Spring 2018

File and Disk Encryption

ENCRYPTION USING LESTER HILL CIPHER ALGORITHM

Uzzah and the Ark of the Covenant

Outline. Data Encryption Standard. Symmetric-Key Algorithms. Lecture 4

CPSC 467b: Cryptography and Computer Security

CHAPTER 1 INTRODUCTION TO CRYPTOGRAPHY. Badran Awad Computer Department Palestine Technical college

CPSC 467: Cryptography and Computer Security

Innovation and Cryptoventures. Cryptology. Campbell R. Harvey. Duke University and NBER

Polyalphabetic cyphers

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl

Overview. Public Key Algorithms I

Cryptography MIS

2.1 Basic Cryptography Concepts

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Cryptography Part II Introduction to Computer Security. Chapter 8

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl

CLASSICAL CRYPTOGRAPHY. A Brief Reference for Self Build Crypto assignment

Cryptography Introduction

Chapter 3 Public Key Cryptography

Encryption Algorithms

EEC-682/782 Computer Networks I

3 Symmetric Key Cryptography 3.1 Block Ciphers Symmetric key strength analysis Electronic Code Book Mode (ECB) Cipher Block Chaining Mode (CBC) Some

Senior Math Circles Cryptography and Number Theory Week 1

CPSC 467b: Cryptography and Computer Security

CHAPTER 2 LITERATURE SURVEY

Introduction to Cryptography. In the News: Hacker exposes embassies'

2.3 SUBTITUTION CIPHERS.

Glenda Whitbeck Global Computing Security Architect Spirit AeroSystems

CPSC 467b: Cryptography and Computer Security

Sirindhorn International Institute of Technology Thammasat University

Computer Security 3/23/18

Introduction to Symmetric Cryptography

Introduction. CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell

Cryptography Introduction

Private-Key Encryption

Introduction to Network Security Missouri S&T University CPE 5420 Cryptology Overview

CPSC 467b: Cryptography and Computer Security

Cryptography Math/CprE/InfAs 533

Introduction to Cryptology. Lecture 2

Cryptographic Concepts

Transcription:

L2. An Introduction to Classical Cryptosystems Rocky K. C. Chang, 23 January 2015

This and the next set of slides 2

Outline Components of a cryptosystem Some modular arithmetic Some classical ciphers Shift Cipher Substitution Cipher Affine Cipher Vigenère Cipher Permutation Cipher Stream Ciphers Attack models and cryptanalysis 3

4 Elements of a secret-key cryptosystem

The Cryptosystem Eve m c m Alice Encryptor decryptor Bob K Secure channel Key source 5

A cryptosystem consists of M: a finite set of possible plaintexts C: a finite set of possible ciphertexts K: the key space, a finite set of possible keys E: A set of encryption rules D: A set of decryption rules For each K K, there is an E K () E and a D K () D, such that D K (E K (m)) = m for every m M. 6

Requirements for a practical cryptosystem Note that E K () must be a 1-to-1 function. If M = C, then E K () is a permutation. Practically, E K () and D K () should be efficiently computable. An attacker, upon seeing a ciphertext, should be unable to determine the key or the plaintext. The attack models Cryptanalysis: attempt to compute K given some ciphertexts. 7

8 Several classical ciphers

First, recall some modular arithmetic Suppose a and b are integers, and n is a positive integer (modulus). a mod n = the remainder of a/n {0, 1,, n 1}. Congruence a b (mod n) iff a mod n = b mod n, i.e., same remainders. a is congruent to b modulo n. E.g., 101 mod 7 = 714 + 3 = 3-101 mod 7 = 7(-15) + 4 = 4 9

The Shift Cipher Let M = C = K = {0, 1, 2,, 25} For 0 K 25, define E K (m) = (m + K) mod 26 D K (c) = (c K) mod 26 For example, K = 11 m: 22 4 22 8 11 11 12 4 4 19 c: 7 15 7 19 22 22 23 15 15 4 For K = 3, the Shift Cipher is often called the Caesar Cipher. Show that D K (E K (m)) = m for every mm. 10

The Substitution Cipher Let M = C = {0, 1, 2,, 25} K = {All possible permutations of the 26 numbers} For each permutation K K, define E K (m) = K(m) = c D K (c) = K -1 (c), the inverse permutation For example, one possible K is a b c d e f g h i j k l m n o p q r s X N Y A H P O G Z Q W B T S F L R C V E K (a) = X and D K (X) = a Is this cipher more secure? 11

Affine Cipher Let M = C = {0, 1, 2,, 25} K = (a, b), where a, b {0, 1, 2,, 25}. Encryption and decryption functions; E K (m) = (am + b) mod 26 D K (c) = a -1 (c - b) mod 26 E K (m) is not an one-to-one function for all a. When a = 1, Affine Cipher is the same as a Shift Cipher. Affine Cipher is still a special case of the Substitution Cipher. 12

The Vigenère (vee zhun AIR) Cipher Monoalphabetic (e.g., Shift and Substitution) vs polyalphabetic (e.g., Vigenère) M = C = K = (Z 26 ) n, where n is a positive integer. For a key K (keyword) = (k 1, k 2,, k n ), define E K (m 1, m 2,, m n ) = (m 1 +k 1, m 2 +k 2,, m n +k n ) D K (c 1, c 2,, c n ) = (c 1 k 1, c 2 k 2,, c n k n ), where the additions and subtractions are done in mod 26. For example, n= 6 and K = (2, 8, 15, 7, 4, 17), m: 19 7 8 18 2 17 24 15 19 14 18 24 K: 2 8 15 7 4 17 2 8 15 7 4 17 c: 21 15 23 25 6 8 0 23 8 21 22 15 13

The Permutation (or Transposition) Cipher All the ciphers so far involve substitution: a plaintext symbol replaced by a different symbol. A permutation cipher keeps the plaintext symbols unchanged but to alter their positions. M = C = (Z 26 ) n K = {All permutations of 1, 2,, n}. For a key K (a given permutation), define E K (m 1, m 2,, m n ) = (m K(1), m K(2),, m K(n) ) D K (c 1, c 2,, c n ) = (c K -1 (1), c K -1 (2),, c K -1 (n) ). 14

The Permutation Cipher (cont d) For example, n = 6 i: 1 2 3 4 5 6 K(i): 3 6 1 5 2 4 m : s h e s e l l s s e a s c : e e s l s h s a l s e s 15

The Stream Cipher The cryptosystems considered so far are known as block ciphers. The plaintexts are encrypted using the same key. An alternative is to generate a key stream y 1 y 2 y 3,. c = E y1 (m 1 )E y2 (m 2 )E y3 (m 3 ). M, C, and K are the same as before. g, the keystream generator, takes a key K to generate y 1 y 2 y 3,, where y i L. For each y in the keystream, there is an encryption rule E y () and a corresponding decryption rule D y (), such that D y (E y (m)) = m for every m M. 16

The Vigenère Cipher and the Stream Cipher Define Vigenère Cipher as a Stream Cipher: M = C = L = Z 26 (note the difference here) K = (Z 26 ) n For each y L, E y (m) = (m + y) mod 26 D y (m) = (c y) mod 26 The keystream: y i = k i if 1 i n; y i = k i-n, else. 17

Block cipher vs stream cipher Stream ciphers are typically faster than block. Block ciphers typically require more memory as their operations are based on blocks. Stream ciphers are more difficult to implement correctly. Block ciphers are more susceptible to noise in transmission. Stream ciphers do not provide integrity protection or authentication, whereas some block ciphers could provide them. 18

Attack models What kind of information available to the attacker? Kerckhoff s principle: a cryptosystem should be secure even if everything about the system, except the key, is public knowledge. The attack s objective is to determine the key in use. Different attack models: Ciphertext-only attack: Eve possesses ciphertexts. Known-plaintext attack: Eve possesses plaintexts and the corresponding ciphertexts. Chosen-plaintext attack: Eve can temporarily choose a plaintext and construct the corresponding ciphertext. Chosen-ciphertext attack: Eve can temporarily choose a ciphertext and construct the corresponding plaintext. 19

Cryptanalysis The Shift, Substitution, and Vigenère Ciphers are vulnerable to ciphertext-only attacks. The Permutation and Stream Ciphers are vulnerable to known-plaintext attacks. Most of the cryptanalysis are based on statistical properties of the English language. E has the highest occurrence rate (0.12) T, A, O, I, N, S, H, R (0.06-0.09) V, K, J, X, Q, Z (< 0.01) Popular digrams: TH, HE, IN, ER, Popular trigrams: THE, ING, AND, HER, 20

Cryptanalysis of the Vigenère Cipher The first step is to determine n, the keyword length using Kasiski test. The method is based on 2 identical segments of plaintext will be encrypted to the same ciphertext if they are d positions apart, where d 0 (mod n). If 2 identical segments of ciphertext found and each length 3, it is likely that they correspond to identical segments of plaintext. The test: Search the ciphertext for pairs of identical segments of length 3. If exists, record the distance between them, say d 1, d 2,. n must divide the greatest common divisor of d 1, d 2,. 21

Conclusions Classical ciphers can be classified as Substitution vs permutation Monoalphabetic vs polyalphabetic Stream ciphers (e.g., JK Flip-Flop, A5, SEAL, RC4) vs block ciphers (e.g., DES, IDEA, AES, RC2) Various stream ciphers: http://en.wikipedia.org/wiki/stream_cipher#usage Ciphers security The size of the key space Vulnerability under cryptanalysis 22

Acknowledgments This set of slides is prepared mainly based on D. Stinson, Cryptography: Theory and Practice, Chapman & Hall/CRC, Second Edition, 2002. Some of the book s materials can be found at http://www.maths.uwa.edu.au/~praeger/teaching/3cc/www/ chapter2.html The slide on block cipher vs stream cipher is based on http://security.stackexchange.com/questions/334/advantagesand-disadvantages-of-stream-versus-block-ciphers Cryptool portal: https://www.cryptool.org/en/ 23