Shared Secret = Trust

Similar documents
Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

Solutions to Problem Set 1

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Hill s Cipher: Linear Algebra in Cryptography

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

RSA and Primality Testing

Introduction to Hill cipher

CSCE 465 Computer & Network Security

Network Security. Security Attacks. Normal flow: Interruption: 孫 宏 民 Phone: 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室

Computer Networks. Network Security 1. Professor Richard Harris School of Engineering and Advanced Technology

Network Security CS 5490/6490 Fall 2015 Lecture Notes 8/26/2015

Chapter 3. if 2 a i then location: = i. Page 40

SECURITY IN NETWORKS

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

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Public Key Cryptography: RSA and Lots of Number Theory

CSC474/574 - Information Systems Security: Homework1 Solutions Sketch

Secure Network Communication Part II II Public Key Cryptography. Public Key Cryptography

Introduction to Encryption

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

How To Understand And Understand The History Of Cryptography

Public Key Cryptography and RSA. Review: Number Theory Basics

Network Security. Security. Security Services. Crytographic algorithms. privacy authenticity Message integrity. Public key (RSA) Message digest (MD5)

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works.

Symmetric Mechanisms for Authentication in IDRP

Symmetric Key cryptosystem

7! Cryptographic Techniques! A Brief Introduction

Forward Secrecy: How to Secure SSL from Attacks by Government Agencies

Network Security: Cryptography CS/SS G513 S.K. Sahay

Network Security. HIT Shimrit Tzur-David

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

Lukasz Pater CMMS Administrator and Developer

RSA Encryption. Tom Davis October 10, 2003

K80TTQ1EP-??,VO.L,XU0H5BY,_71ZVPKOE678_X,N2Y-8HI4VS,,6Z28DDW5N7ADY013

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

An Introduction to Hill Ciphers Using Linear Algebra

Notes on Network Security Prof. Hemant K. Soni

CS 758: Cryptography / Network Security

Cryptography Exercises

Thinking of a (block) cipher as a permutation (depending on the key) on strings of a certain size, we would not want such a permutation to have many

Public Key (asymmetric) Cryptography

Cryptography and Network Security

Cryptography & Network Security

Outline. CSc 466/566. Computer Security. 8 : Cryptography Digital Signatures. Digital Signatures. Digital Signatures... Christian Collberg

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

Lecture 6 - Cryptography

Chapter 2 Homework 2-5, 7, 9-11, 13-18, 24. (9x + 2)(mod 26) y 1 1 (x 2)(mod 26) 3(x 2)(mod 26) U : y 1 = 3(20 2)(mod 26) 54(mod 26) 2(mod 26) c

The application of prime numbers to RSA encryption

Lecture 3: One-Way Encryption, RSA Example

How To Know If A Message Is From A Person Or A Machine

1. Define: (a) Variable, (b) Constant, (c) Type, (d) Enumerated Type, (e) Identifier.

Cryptography: Motivation. Data Structures and Algorithms Cryptography. Secret Writing Methods. Many areas have sensitive information, e.g.

1 Domain Extension for MACs

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

SFWR ENG 4C03 - Computer Networks & Computer Security

Computer Security: Principles and Practice

IT Networks & Security CERT Luncheon Series: Cryptography

CIS433/533 - Computer and Network Security Cryptography

Network Security. Gaurav Naik Gus Anderson. College of Engineering. Drexel University, Philadelphia, PA. Drexel University. College of Engineering

Chapter 10. Network Security

Cryptography and Network Security

FAREY FRACTION BASED VECTOR PROCESSING FOR SECURE DATA TRANSMISSION

Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY. Sourav Mukhopadhyay

Computer Networks. Network Security and Ethics. Week 14. College of Information Science and Engineering Ritsumeikan University

Cryptography and Network Security Chapter 9

A short primer on cryptography

Lecture 13 - Basic Number Theory.

Application Layer (1)

How To Encrypt With A 64 Bit Block Cipher

The science of encryption: prime numbers and mod n arithmetic

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

RSA Attacks. By Abdulaziz Alrasheed and Fatima

1 Message Authentication

A Proposal for Authenticated Key Recovery System 1

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Table of Contents. Bibliografische Informationen digitalisiert durch

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

Fundamentals of Computer Security

Elements of Applied Cryptography Public key encryption

Network Security Technology Network Management

Cryptography and Network Security Chapter 10

An Introduction to Cryptography and Digital Signatures

Security in Distributed Systems. Network Security

8 Primes and Modular Arithmetic

Overview of Public-Key Cryptography

A SOFTWARE COMPARISON OF RSA AND ECC

Cryptography Lecture 8. Digital signatures, hash functions

Paillier Threshold Encryption Toolbox

CrypTool Claudia Eckert / Thorsten Clausius Bernd Esslinger / Jörg Schneider / Henrik Koy

Cyber Security Workshop Encryption Reference Manual

Cryptography and Network Security

Application Layer (1)

Hash Functions. Integrity checks

VALLIAMMAI ENGINEERING COLLEGE

The Mathematics of the RSA Public-Key Cryptosystem

Chapter 7: Network security

Properties of Real Numbers

Advanced Cryptography

Transcription:

Trust The fabric of life! Holds civilizations together Develops by a natural process Advancement of technology results in faster evolution of societies Weakening the natural bonds of trust From time to time artificial mechanisms need to be introduced eg photo ids Cryptography is a trust building mechanism We are at a point (or about to arrive at a point) where cryptography needs to be part of our day-to-day lives

Shared Secret = Trust At the crux of cryptography is the assumption that TRUST = SHARED SECRET How do we leverage shared secret to build trust? Components of Trust Secrecy, Authentication, Non-repudiation, Integrity, Identity Cryptographic Primitives Encryption/Decryption, Digital Signatures, Hash (oneway) functions, random sequence generators

Cryptography Encryption and Decryption Plain Text Encryption Cipher Text Cipher Text Decryption Plain Text Two ways Symmetric Cryptography (shared key) Asymmetric Cryptography (two-key / public-key)

An Analogy - Shared Secret as a Key Alice and Bob share a key to a lock Handling messages Put them in a box Secure the box with the lock Alice knows only Bob has a key (and viceversa) Shared key enables trust Modern cryptography uses bits and computer programs not locks and keys!

Asymmetric Key Cryptography Encrypt with public key Decrypt with private key Private key is secret, public key is not (could be entered in some on-line public directory) Used for Secrecy and Digital Signatures Plain Text Encryption Cipher Text Plain Text Encryption Signed Text Cipher Text Decryption Plain Text Signed Text Decryption Plain Text

Asymmetric Key Cryptography Alice, Bob and Oscar - have never met before no shared secret Alice announces her public key to Bob (Oscar also listens) Bob chooses a secret randomly and encrypts it with Alice's public key Alice can decrypt Bob's message and determine Bob's chosen secret Oscar cannot (he does not have access to Alice's Private key) Now Alice and Bob have a shared secret! Notion of Public key cryptography is definitely not intuitive!

Illustration of Asymmetric Key Cryptography Simple box with a lock won't work - need a more sophisticated contraption! Message box (locker) with trapdoors Encryption and Digital Signatures Front door opened with public key to drop messages for Alice and collect documents signed by Alice Back door can be opened only by Alice with her private key. Only an analogy. Need trapdoor one-way functions to realize asymmetric cryptography.

Paper and Pencil Cryptography Read Sections 2.1 through 2.3 of text Evolution of Cryptography First documented use by Julius Caesar Caesar Cipher (Enciphering and Deciphering) MEET YOU TOMORROW (Plain Text) RJJY DTZ YTRTWWTB (Cipher Text) 26 possible keys (0-25, key 5 used in example above) Vignere Cipher (26 x m keys) M E E T Y O U T O M O R R O W D O G D O G D O G D O G D O G (4,15,7), m=3 P S K W M U X H U P C X U C C

More P&P Ciphers Auto-key Vignere Cipher MEET YOU TOMORROW (Plain Text) HIYA (key) Extended key H I Y A M E E T Y O U T O M O Cipher M E E T Y O U T O M O R R O W H I Y A M E E T Y O U T O M O T M C T K S Y M M A I K F A K

Even More Ciphers! A more complex substitution Cipher Each letter substituted by an arbitrary letter Full Vignere. Key generation NETWORKSECURI TY ANDCRYPTOGRAPHYBIZ NETWORKSCU IYA DPGHBZFJ LMQVX ABCD EFGHI J KLMNOPQRSTUVWXYZ 26! (403291461126605635584000000) keys Permutation Ciphers Text length M AND -> (2,3,1) -> NDA M! possible permutations Combination of substitution and permutation Repeated application many rounds

Lets do some math! Mathematics is a language! Often when we develop mathematical tools we lose perspective... Not just about numbers Language consists of statements A statement is an expression of TRUTH Numbers Whole Numbers Zero Integers - Zero + Whole Numbers + Negative Whole Numbers Rational numbers Real numbers Complex numbers

Modular Arithmetic (Read Sections 4.1 thro 4.4) Set of all integers Set of positive integers less than m Z m ={0,1,2,3,... m 1} We want to perform arithmetic in Z m Equivalence Classes Say m = 5 EC of 0 {...-15,-10,-5,0,5,10,...} 15 10 5... 0 5... mod m EC 0f 1 {...-14,-9,-4,1,6,11,...} EC 0f 2 {...-13,-8,-3,2,7,12,...} EC 0f 3 {...-12,-7,-2,3,8,13,...} EC 0f 4 {...-11,-6,-1,4,9,14,...} Z={,... 3, 2, 1,0,1,2,3,... } a b mod m a=b cm; a, b,c, m Z

Addition mod m a b mod m a=b km c d mod m c=d lm a c c a mod m a c b d a d b c mod m a c =b d k l m= b d jm

Multiplication mod m a b mod m a=b km c d mod m c=d lm ac= b km d lm =bd bl kd klm m ac bd mod m

What about division? Is division possible in Z? Group, Abelian Group, Ring and Field Group Addition is closed, associative Existence of additive identity, additive inverse Abelian group addition is also commutative Ring Multiplication is closed, associative, commutative, multiplicative identity, distributive Field every element except additive identity has multiplicative inverse

Multiplicative Inverse Additive identity is 0 Multiplicative identity is 1 Consider m = 5 2 -> multiplicative inverse is 3 as 2*3 1 mod 5 3 -> 2 4 -> 4 4*4 1 mod 5 Obviously 1 is its own inverse Now m = 6 5 -> inverse is 5 as 5*5 1 mod 6 What about 2,3 and 4? No inverses - why?

Basic Theorems of Arithmetic Let p i represent the i th prime e n= i,ei pi i=1 0 n n= i pi i=1 m m= i pi i=1 max n i, m i pi lcm m, n = i=1 gcd m, n = i=1 pi min n i, m i

Preliminaries gcd(m,n) is usually represented as (m,n) If n = km, (and k is an integer) we say m n (m divides n) The number s = (m,n) is the largest positive integer such that s m and s n If (m,n)=1, and if m a and n a then mn a

Algorithm for GCD Basic idea - if a = qb + c then (a,b) = (b,c) Let s = (a,b) and t = (b,c) s a, s b, t b, t c c = a qb = s(a 1 -qb 1 ) or s c As s b and s c and t is the largest integer that divides both b and c, s t a = qb+c = t(qb 2 +c 2 ) or t a As t b and t a and s is the largest integer that divides both a and b, t s t=s or a, b = b,c if a=qb c

Euclidean Algorithm a 0, a 1,a 0 a 1 a 0 =q 1 a 1 a 2 a 0, a 1 = a 1, a 2 a 1 =q 2 a 2 a 3 a 1, a 2 = a 2, a 3 a i 1 =q i a i a i 1 a i 1,a i = a i,a i 1 a r 2 =q r 1 a r 1 a r a r 1 =q r a r 0 a r 1,a r =a r = a r 2,a r 1 = = a 0, a 1

(457, 283) Euclidean Algorithm

Euclidean Algorithm (457, 283) 457 = 1*283+174

Euclidean Algorithm (457, 283) 457 = 1*283+174 283 = 1*174+109 174 = 1*109+65 109 = 1*65 + 44 65 = 1*44 + 21 44 = 2*21 + 2 21 = 10*2 + 1

Euclidean Algorithm (457, 283) 457 = 1*283+174 283 = 1*174+109 174 = 1*109+65 109 = 1*65 + 44 65 = 1*44 + 21 44 = 2*21 + 2 21 = 10*2 + 1 2 = 2*1 + 0 or (457,283) = (2,1) = 1

Euclidean Algorithm (457, 283) 457 = 1*283+174 283 = 1*174+109 174 = 1*109+65 109 = 1*65 + 44 65 = 1*44 + 21 44 = 2*21 + 2 21 = 10*2 + 1 1 = 21-10*2 2 = 2*1 + 0 or (457,283) = (2,1) = 1

Euclidean Algorithm (457, 283) 457 = 1*283+174 283 = 1*174+109 174 = 1*109+65 109 = 1*65 + 44 65 = 1*44 + 21 44 = 2*21 + 2 1 = 21-10*(44-2*21) 21 = 10*2 + 1 1 = 21-10*2 2 = 2*1 + 0 or (457,283) = (2,1) = 1

Euclidean Algorithm (Extended) (457, 283) 457 = 1*283+174 1 = 135*457 + (-218)*283 283 = 1*174+109 174 = 1*109+65 109 = 1*65 + 44 65 = 1*44 + 21 44 = 2*21 + 2 1 = 21-10*(44-2*21) 21 = 10*2 + 1 1 = 21-10*2 2 = 2*1 + 0 or (457,283) = (2,1) = 1

Bezout's Representation s = (a,b) = ia+jb s is the smallest strictly positive integer that can be written as a combination of a and b If coins are minted in only two denominations a and b can we accomplish any transaction? How can you mark 1 foot with two scales one 9 feet long and the other 7 feet long?

Modular Inverse Does inverse of a mod m exist? aa 1 1 mod m Let b=a 1 ab 1 mod m ab=1 km 1= b a km a, m =1 Inverse exists only if (a,m)=1 If (a,m)=1 then a is relatively prime to m No wonder we could'nt find inverses for 2,3 and 4 in mod 6 Note that (5,6)=1 (so 5 has an inverse in mod 6)

Euclidean Algorithm (Extended) (457, 283) 457 = 1*283+174 1 = 135*457 + (-218)*283 283 = 1*174+109 174 = 1*109+65 109 = 1*65 + 44 65 = 1*44 + 21 44 = 2*21 + 2 1 = 21-10*(44-2*21) 21 = 10*2 + 1 1 = 21-10*2 2 = 2*1 + 0 or (457,283) = (2,1) = 1

Euclidean Algorithm (Extended) (457, 283) 457 = 1*283+174 1 = 135*457 + (-218)*283 283 = 1*174+109 (-218*283) = 1 + (-135)*457 174 = 1*109+65 (-218*283) 1 mod 457 109 = 1*65 + 44-218 239 mod 457 65 = 1*44 + 21 (239*283) 1 mod 457 44 = 2*21 + 2 21 = 10*2 + 1 1 = 21-10*2 2 = 2*1 + 0 or (457,283) = (2,1) = 1

Euclidean Algorithm (Extended) (457, 283) 457 = 1*283+174 1 = 135*457 + (-218)*283 283 = 1*174+109 (-218*283) = 1 + (-135)*457 174 = 1*109+65 (-218*283) 1 mod 457 109 = 1*65 + 44-218 239 mod 457 65 = 1*44 + 21 (239*283) 1 mod 457 239 is the inverse of 283 mod 457 239*283 = 67637 = 1 + 148*457

Prime Modulus What if m is prime? We have Z m = {0,1,2,...,m-1} Every number is relatively prime to a prime number! So every number 1... m-1 has an inverse! Z m forms a FIELD Normally referred to as prime field Z p

Why prime modulus? It is a field Almost all mathematical operations are supported. Crunch away! Cannot decipher patterns Deterministic mathematical functions yet the results seem random! Good for cryptography!

How about Exponentiation? Just repeated multiplication! Lets choose a large prime p and a generator g both are public Choose some number a, and calculate A g a mod p There is a simple algorithm for exponentiation involving repeated squaring - complexity O(log(a)) No algorithm for determining a from A! (complexity O (p))! Why is this feature useful?

Diffie-Helman Key Exchange! (Sneak Peak) Alice and Bob agree on a large prime p and a generator g Alice chooses a secret a, and calculates A g a mod p A is Alice's public key Bob chooses a secret b, and calculates B g b mod p B is Bob's public key Alice and Bob exchange A and B in public Alice calculates S B a mod p g ba mod p Bob calculates S A b mod p g ab mod p Nobody else can calculate S even if they know A,B,g and p! only g a+b mod p (or g a-b ) not very useful!

RECAP Z m = {0,1,2,...,m-1} Z m is a ring addition, multiplication... Multiplicative inverse of a in Z m exists only if (a,m)=1; GCD Euclidean algo Multiplicative Inverse Extended Euclidean Algorithm If m = p (a prime) then Z p is a field Supports all regular operations addition, subtraction, multiplication and multiplicative inverses All elements of the field (except additive identity) has a multiplicative inverse.

Matrix Operations in a Field 2 3 A [1 4] 4 5 7 mod 11 8 6 A 1 det A 1 adj A mod 11 det A 10 mod 11;inv 10 mod 11 10 mod 11 16 56 24 40 adj A [ 20 42 8 18 4 24 6 16 14 15 7 12 5 8 ]T 40 16 adj A [ 22 10 20 10 1 5 3 A 1 10 [0 10 10 7 2 5 6 10 8 ]T mod 11 0 7 6 mod 10 2 10 11 [ 10 5 8 mod 11 ] [0 1 1 4 9 6 5 1 3] ]T

Matrix Operations in a Ring 2 3 A [1 4] 4 5 7 mod 26 8 6 A 1 det A 1 adj A mod 26 det A 10 mod 26 inv 10 mod 26??? 10,26 1 Not Invertible? Not necessarily No unique inverse

Hill Cipher 17 5 K [17 ] 21 18 21 mod 2 2 7 26 det K 1 11 mod 26 9 3 K [10 ] 1 7 17 22 mod 26 10 0 19 P [4 5] 17 5 3 mod 26;C KP [17 ][4 21 18 21 3 9 mod 26 2 2 7 5] [14 23] 9 3 K C [10 1 7 17 22 9 3 10 0 19 ][14 23] [4 5]

HILL CIPHER In Hill cipher the encoding key is K and the decoding key is K -1 does this mean Hill cipher is an asymmetric cipher? Why? For a 3x3 Hill cipher there are 9 secrets. How many known plain-text cipher-text pairs do we need to break the secret?

ATTACK ON HILL CIPHER 17 5 K [17 ] 9 3 21 18 21 mod 26;K [10 ] 1 7 17 22 mod 26 2 2 7 10 0 19 P 1 [4 5] [ 4 ] [ 7 ] 3 mod 26;P 2 21 mod 26 ;P 2 16 mod 26 18 8 C 1 KP 1 [14 9 mod 26;C 23] 2 [21 8 mod 26;C 20] 3 [15 5 mod 26; 24] [14 21 15 4 7 9 8 5 3 21 16 23 20 24] K[4 5 18 8 ] or K PC 1 mod 26 P KCmod 26

HW - 1 3 2 6 53 43 P 1 =[1 3 2 66 23 4 76 23 21 5];P2=[ 42];P3=[44 12];P4=[44 33];P5=[ 2 76 39 47 52]; 29 35 C 1 =[23 78 2 64 8 40];C2=[66 ];C3=[33 ];C4=[71 36 49 35 9 52 51 75 49 61 7 7 13];C5=[66 28]; in mod 79. Find K

Brute-force Attacks on Ciphers C = E(P,K). We have P Try every possible key K P i = D(C,K i ) How do we know when to stop? Under any key there will be a corresponding P i How do we know that a particular P i is the correct plaintext? Does this mean brute force attacks are not possible?

Entropy of Plain Text Think of all possible 100 character strings that make sense For example, say a billion books, each with 1 billion strings that make sense - still makes it only 10 18 possible phrases! How many total strings of length 100? 26 100. That is more than 3 x 10 141! Say we encrypt a meaningful string with a 64 bit key, the ciphertext is decrypted with another key What is the probability that the wrong key results in a string that makes sense? 2 64 * 10 18 /(3*10 141 ) < 6 * 10-105 Which is good news for the attacker...

Vernam Cipher The Ultimate Cipher? What if we make the number of possible keys the same as the number of possible plain text messages? One-time pad Vernam Cipher Cannot try out keys any more! There is always a key which maps cipher text to every possible plain text No way an attacker can eliminate any message all messages are equally likely The attacker learns NOTHING! Perfect Secrecy