Top Banner
Cryptography Introduction Last Updated: Sep 7, 2017
23

Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

May 07, 2018

Download

Documents

haphuc
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: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Cryptography Introduction

Last Updated: Sep 7, 2017

Page 2: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Cryptography• Literal definition means “hidden writing”• Until modern times, cryptography was synonymous with

encryption, but the field has expanded• This lecture reviews a high-level description of four

cryptographic primitives we will learn about this semestero Symmetric Encryption (AES)o Public-Key Cryptography (RSA)o Secure One-Way Hash (SHA-256)o Message Authentication Code (MAC)

Page 3: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

What is Encryption?• Transforming information so that its true meaning is

hiddeno Requires “special knowledge” to retrieve

• Modern encryption algorithms use transposition and substitution in complex ways that are hard to reverse

• Examples from history that are easy to breako ROT-13 (aka Caesar Cipher) is easy to break, simple substitution ciphero Vigenere cipher – polyalphabetic substitution cipher

• Examples of strong encryptiono AESo 3DESo RC4o RSA

Page 4: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Cipher

Classical

Substitution Steganography Transposition

Rotor Machines

Modern

Public Key Secret Key

Types of Encryption Schemes

Hierarchy & Examples based on:http://en.wikipedia.org/wiki/Cipher

GOOD DOGPLLX XLPPLSX TWF

GOOD DOGDGOGDOO

Page 5: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

• One-Time Pad (XOR message with key)• Example*:

o Message: ONETIMEPADo Key: TBFRGFARFMo Ciphertext: IPKLPSFHGQ

o The key TBFRGFARFM decrypts the message to ONETIMEPADo The key POYYAEAAZX decrypts the message to SALMONEGGSo The key BXFGBMTMXM decrypts the message to GREENFLUID

Perfect Encryption Scheme?

*From Applied Cryptography (Schneier)

Page 6: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Symmetric Encryption• Also known as

o Conventional encryptiono Secret-key encryptiono Single-key encryption

Page 7: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Encryption Algorithm Decryption Algorithm

Symmetric Encryption Model

Alice Bob

Plaintext

Key Key

Ciphertext Plaintext

Page 8: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Use Cases• Web browsing using HTTPS• Encrypted chat (WhatsApp and Signal)• Encrypted email (PGP)

Page 9: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Cryptographic Hash Function

Source: http://en.wikipedia.org/wiki/Cryptographic_hash_function

Page 10: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Hashing Use Cases• Digital signature• File integrity verification (TripWire)• Password hashing• Rootkit detection

Page 11: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Message Authentication Code (MAC)

Source: Network Security Essentials (Stallings)

Page 12: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

HMAC Use Cases• Web browser message integrity (HTTPS)• Integrity of messages in authentication protocols• Cookie integrity• Web application remote procedure calls

Page 13: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Encryption Algorithm Decryption Algorithm

Model for Encryption with Public Key Cryptography

Alice Bob

Plaintext

Bob’s Public Key Bob’s Private Key

Ciphertext Plaintext

Page 14: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Signing Algorithm Verification Algorithm

Model for Digital Signature with Public Key Cryptography

Alice Bob

Plaintext

Alice’s Private Key Alice’s Public Key

Plaintext?

Page 15: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Symmetric Encryption

Page 16: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Requirements1. Strong algorithm (cipher)

Attacker is unable to decrypt ciphertext or discover the key even if attacker has samples of ciphertext/plaintext created using the secret key

2. Fast

Assumption: Sender and receiver must securely obtain and store the secret key

Page 17: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Kerckhoffs’ Principle• The security of the symmetric encryption depends on the

secrecy of the key, not the secrecy of the algorithm

Dr. Auguste Kerckhoffs (1835-1903)Dutch linguist and cryptographer

Page 18: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Types of Ciphers• Block cipher (3DES, AES)

o Plaintext is broken up into fixed-size blockso Typical block size (64, 128 bits)

• Stream cipher (RC4)o Process plaintext continuouslyo Usually one byte at a time

Page 19: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

• Algorithmo Relying on the secrecy of the algorithm

• Example: Substitution cipherso Using an algorithm incorrectly

• Example: WEP used RC4 incorrectly

• Keyo Too big

• Slow• Storage

o Too small• Vulnerable to brute force attack – try all possible keys

What can go wrong?

Page 20: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

• Cryptography uses REALLY big numberso 1 in 261 odds of winning the lotto and being hit by lightning on the same dayo 292 atoms in the average human bodyo 2128 possible keys in a 128-bit keyo 2170 atoms in the planeto 2190 atoms in the suno 2233 atoms in the galaxyo 2256 possible keys in a 256-bit key

Big Numbers

Page 21: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

• Physics: To set or clear a bit requires no less than kTo k is the Boltzman constant (1.38*10-16 erg/ºK)o T is the absolute temperature of the system

• Assuming T = 3.2ºK (ambient temperature of universe) o kT = 4.4*10-16 ergs

• Annual energy output of the sun 1.21*1041 ergso Enough to cycle through a 187-bit counter

• Build a Dyson sphere around the sun and collect all energy for 32 yearso Enough energy to cycle through a 192-bit counter.

• Supernova produces in the neighborhood of 1051 ergso Enough to cycle through a 219-bit counter

Thermodynamic Limitations*

*From Applied Cryptography (Schneier)

Page 22: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Public Key Cryptography• Terminology

o Public Keyo Private Keyo Digital Signature

• Confidentialityo You encrypt with a public key, and you decrypt with a private key

• Integrity/Authenticationo You sign with a private key, and you verify the signature with the corresponding

public key

• Exampleso Diffie-Hellmano RSAo Elliptic Curve Cryptography (ECC)o Identity-based Encryption (IBE)

Page 23: Cryptography Introduction - start [CS Wiki] · Substitution Steganography Transposition Rotor Machines Modern Public Key Secret Key ... o RSA o Elliptic Curve Cryptography (ECC) o

Assignment• Review this slide deck regularly to learn the high level

abstractions for these primitives. I’ll expect you to describe them to me on an exam without any notes. o You don’t really know something until you can teach it to someone else

• Study the AES NIST spec and watch the flash demo