Top Banner
Introduction to Cryptography by Petre POPESCU
26

Introduction to Cryptography

Dec 02, 2014

Download

Technology

Popescu Petre

A short introduction to cryptography. What is public and private key cryptography? What is a Caesar Cipher and how do we decrypt it? How does RSA work?
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Cryptography

Introduction to Cryptography

by Petre POPESCU

Page 2: Introduction to Cryptography

What is cryptography?

"the art of hiding information"

OR

"the practice and study of techniques for secure communication in the presence of third parties"

(wikipedia)

Page 3: Introduction to Cryptography

Modern Cryptography

a branch of mathematics and

computer science

Page 4: Introduction to Cryptography

Modern Cryptography

2 main branches

1. Private Key Cryptography2. Public Key Cryptography

Page 5: Introduction to Cryptography

Private Key Cryptography

The same key is used for both encryption and decryption

Page 6: Introduction to Cryptography

Private Key Cryptography

Examples:- DES- AES- Caesar Cipher- Blowfish

Page 7: Introduction to Cryptography

Caesar Cipher

Named after Julius Caesar, who used it in his private and military

correspondence.

Page 8: Introduction to Cryptography

Caesar Cipher

It is a substitution cipher

Each letter is replaced by another letter depending on a "shift" value

Page 9: Introduction to Cryptography

Caesar Cipher

Page 10: Introduction to Cryptography

Cracking Caesar Cipher

(assuming we know Caesar Cipher is used)

1. Brute Force Attack2. Word-pattern and letter distribution

attack

Page 11: Introduction to Cryptography

Brute Force Attack

Since the number of possible shifts is limited, it is feasible to try each shift and discard the results that are not human readable.

Page 12: Introduction to Cryptography

Word-pattern and letter distribution attack

Step 1:Find the average distribution of letter

in that language. This can be done with ease by

analyzing long texts.

Page 13: Introduction to Cryptography

Word-pattern and letter distribution attack

Step 2:A Caesar Cipher usually "shifts" this

distribution by the shift used for encryption.

An error margin is permitted, so now multiple possibilities are generated.

Page 14: Introduction to Cryptography

Word-pattern and letter distribution attack

Step 3:Decrypt the text using the possible

shifts that were found in step 2.Use word-pattern analysis (and

possibly a dictionary of words) to discover the correct variant

Page 15: Introduction to Cryptography

Public Key Cryptography

Two keys are needed:- one for encrypting the message- one for decrypting the message

Page 16: Introduction to Cryptography

Public Key Cryptography

Key's properties- neither keys can perform both

operations- the two keys are mathematically

paired- public key - used for encryption- private key - used for decryption

Page 17: Introduction to Cryptography

Public Key Cryptography

Examples:- RSA- YAK- Various elliptic curve techniques

Page 18: Introduction to Cryptography

RSA

Created by: Ron RivestAdi ShamirLeonard Adleman

Is based on the presumed difficulty of factoring large integers.

Page 19: Introduction to Cryptography

RSA - Generating the two keys

(1) Choose two distinct prime numbers:p and q

p and q should have high bit-lengthp and q should be chosen at random

Page 20: Introduction to Cryptography

RSA - Generating the two keys

(2) Computen = pq

n is the "modulus" for both the public and private keys

Page 21: Introduction to Cryptography

RSA - Generating the two keys

(3) Computeφ(n) = φ(p)φ(q) = (p − 1)(q − 1)

Page 22: Introduction to Cryptography

RSA - Generating the two keys

(4) Choose e such that 1 < e < φ(n)

andgcd(e, φ(n))

TIP: e and φ(n) are coprime

Page 23: Introduction to Cryptography

RSA - Generating the two keys

"e" is the Public Key Exponent

Page 24: Introduction to Cryptography

RSA - Generating the two keys

(5) Compute d whered−1 ≡ e (mod φ(n))

ord is the multiplicative inverse of

e (modulo φ(n))

Page 25: Introduction to Cryptography

RSA - Generating the two keys

To calculate dsolve for d given

d*e ≡ 1 (mod φ(n))

Page 26: Introduction to Cryptography

RSA - Generating the two keys

Public Key: e and nPrivate Key: d and n

d, p, q and φ(n) must be kept secret