CIS433/533 - Computer and Network Security Cryptography



Similar documents
How To Understand And Understand The History Of Cryptography

Lecture 6 - Cryptography

Cryptography and Network Security

CSCE 465 Computer & Network Security

7! Cryptographic Techniques! A Brief Introduction

Table of Contents. Bibliografische Informationen digitalisiert durch

Common Pitfalls in Cryptography for Software Developers. OWASP AppSec Israel July The OWASP Foundation

Cryptography and Network Security Chapter 3

Fundamentals of Computer Security

Hash Functions. Integrity checks

Chapter 11 Security+ Guide to Network Security Fundamentals, Third Edition Basic Cryptography

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

lundi 1 octobre 2012 In a set of N elements, by picking at random N elements, we have with high probability a collision two elements are equal

Lecture 9: Application of Cryptography

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

Lecture 4 Data Encryption Standard (DES)

Overview of Symmetric Encryption

Lecture Note 8 ATTACKS ON CRYPTOSYSTEMS I. Sourav Mukhopadhyay


Message Authentication Codes

SAMPLE EXAM QUESTIONS MODULE EE5552 NETWORK SECURITY AND ENCRYPTION ECE, SCHOOL OF ENGINEERING AND DESIGN BRUNEL UNIVERSITY UXBRIDGE MIDDLESEX, UK

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

Cryptographic hash functions and MACs Solved Exercises for Cryptographic Hash Functions and MACs

How To Encrypt With A 64 Bit Block Cipher

IT Networks & Security CERT Luncheon Series: Cryptography

Introduction to Computer Security

Part I. Universität Klagenfurt - IWAS Multimedia Kommunikation (VK) M. Euchner; Mai Siemens AG 2001, ICN M NT

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

Chapter 8. Network Security

Cryptographic Hash Functions Message Authentication Digital Signatures

HASH CODE BASED SECURITY IN CLOUD COMPUTING

Block encryption. CS-4920: Lecture 7 Secret key cryptography. Determining the plaintext ciphertext mapping. CS4920-Lecture 7 4/1/2015

Lecture 9 - Network Security TDTS (ht1)

CS155. Cryptography Overview

Cryptography & Network Security

Cryptography Lecture 8. Digital signatures, hash functions

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

Authentication requirement Authentication function MAC Hash function Security of

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

CSE/EE 461 Lecture 23

The Misuse of RC4 in Microsoft Word and Excel

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

CIS 433/533 - Computer and Network Security Public Key Crypto/ Cryptographic Protocols

Developing and Investigation of a New Technique Combining Message Authentication and Encryption

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

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

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

1 Data Encryption Algorithm

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

CRYPTOGRAPHY IN NETWORK SECURITY

Cryptography and Network Security Chapter 11

CSCI-E46: Applied Network Security. Class 1: Introduction Cryptography Primer 1/26/16 CSCI-E46: APPLIED NETWORK SECURITY, SPRING

Message Authentication

MAC. SKE in Practice. Lecture 5

Cryptography & Digital Signatures

SECURITY IN NETWORKS

Massachusetts Institute of Technology Handout : Network and Computer Security October 9, 2003 Professor Ronald L. Rivest.

Network Security - ISA 656 Introduction to Cryptography

Cryptography Overview

CS 758: Cryptography / Network Security

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

Message Authentication Codes. Lecture Outline

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

Chapter 7: Network security

Network Security. Modes of Operation. Steven M. Bellovin February 3,

Network Security. HIT Shimrit Tzur-David

Module: Applied Cryptography. Professor Patrick McDaniel Fall CSE543 - Introduction to Computer and Network Security

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

SeChat: An AES Encrypted Chat

Network Security. Chapter 3 Symmetric Cryptography. Symmetric Encryption. Modes of Encryption. Symmetric Block Ciphers - Modes of Encryption ECB (1)

One-Way Encryption and Message Authentication

Provable-Security Analysis of Authenticated Encryption in Kerberos

Cryptography & Network Security. Introduction. Chester Rebeiro IIT Madras

Cryptography and Network Security Chapter 12

Security and Authentication Primer

Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle. Network Security. Chapter 13

Effective Secure Encryption Scheme [One Time Pad] Using Complement Approach Sharad Patil 1 Ajay Kumar 2

CSCE 465 Computer & Network Security

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

Cryptography and Network Security Block Cipher

Symmetric Key cryptosystem

Signature Schemes. CSG 252 Fall Riccardo Pucella

AC76/AT76 CRYPTOGRAPHY & NETWORK SECURITY DEC 2014

{(i,j) 1 < i,j < n} pairs, X and X i, such that X and X i differ. exclusive-or sums. ( ) ( i ) V = f x f x

Evaluation of the RC4 Algorithm for Data Encryption

Chapter 8 Network Security. Slides adapted from the book and Tomas Olovsson

Designing Hash functions. Reviewing... Message Authentication Codes. and message authentication codes. We have seen how to authenticate messages:

Network Security Technology Network Management

AN IMPLEMENTATION OF HYBRID ENCRYPTION-DECRYPTION (RSA WITH AES AND SHA256) FOR USE IN DATA EXCHANGE BETWEEN CLIENT APPLICATIONS AND WEB SERVICES

Network Security. Omer Rana

Chapter 8. Cryptography Symmetric-Key Algorithms. Digital Signatures Management of Public Keys Communication Security Authentication Protocols

How To Encrypt Data With Encryption

WINTER SCHOOL ON COMPUTER SECURITY. Prof. Eli Biham

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

Counter Expertise Review on the TNO Security Analysis of the Dutch OV-Chipkaart. OV-Chipkaart Security Issues Tutorial for Non-Expert Readers

1 Step 1: Select... Files to Encrypt 2 Step 2: Confirm... Name of Archive 3 Step 3: Define... Pass Phrase

Message Authentication Code

Computer Security: Principles and Practice

Transcription:

CIS433/533 - Computer and Network Security Cryptography Professor Kevin Butler Winter 2011 Computer and Information Science

A historical moment Mary Queen of Scots is being held by Queen Elizabeth and accused of treason. All communication with coconspirators encrypted. Cipher was unbreakable. Walsingham needs to prove complicity. 2

Intuition Cryptography is the art (and sometimes science) of secret writing Less well known is that it is also used to guarantee other properties, e.g., authenticity and integrity of data This is an mathmatically deep and important field However, much of our trust in cryptographic systems is based on faith (particularly in efficient secret key algorithms) ask Mary Queen of Scots how that worked out. This set of lectures will provide the intuition and some specifics of modern cryptography, seek others for additional details (Menezes et. al.). 3

Cryptography Cryptography (cryptographer) Creating ciphers Cryptanalysis (cryptanalyst) Breaking ciphers The history of cryptography is an arms race between cryptographers and cryptanalysts 4

Encryption algorithm Algorithm used to make content unreadable by all but the intended receivers Encrypt(plaintext,key) = ciphertext Decrypt(ciphertext,key) = plaintext Algorithm is public, key is private Block vs. Stream Ciphers Block: input is fixed blocks of same length Stream: stream of input 5

Hardness and security... Functions Plaintext P Ciphertext C Encryption (E) key ke Decryption (D) key kd D(E(P, ke),kd) = P Computing P from C is hard, computing P from C with kd Is easy for all Ps (operation true for all inputs)...... except in some vanishingly small number of cases 6

Example: Caesar Cipher Substitution cipher Every character is replaced with the character three slots to the right A B C D E F G H I J K L M N O P Q R S T U V W X Y Z D E F G H I J K L M N O P Q R S T U V W X Y Z A B C Q: What is the key? S E C U R I T Y A N D P R I V A C Y V H F X U L W B D Q G S U L Y D F B 7

Cyptanalyze this. BERTBA ARGJBEX FRPHEVGL 8

Cryptanalysis of ROTx Ciphers Goal: to find plaintext of encoded message Given: ciphertext How: simply try all possible keys Known as a brute force attack 1 T F D V S J U Z B M E Q S J W B D Z 2 U G E W T K V A C N F R T H X C E A 3 W H F X U L W B D Q G S U L Y D F B S E C U R I T Y A N D P R I V A C Y 9

Attacking a Cipher The attack mounted will depend on what information is available to the adversary Ciphertext-only attack: adversary only has the ciphertext available and wants to determine the plaintext encrypted Known-plaintext attack: adversary learns one or more pairs of ciphertext/plaintext encrypted under the same key, tries to determine plaintext based on a different ciphertext Chosen-plaintext attack: adversary can obtain the encryption of any plaintext, tries to determine the plaintext for a different ciphertext Chosen-ciphertext attack: adversary can obtain the plaintext of any ciphertext except the one the adversary wants to decrypt 10

Shared key cryptography Traditional use of cryptography Symmetric keys, where a single key (k) is used is used for encryption (E) and decryption (D) D(E(p,k),k) = p All (intended) receivers have access to key Note: Management of keys determines who has access to encrypted data E.g., password encrypted email Also known as symmetric key cryptography 11

Key size and algorithm strength Key size is an oft-cited measure of the strength of an algorithm, but is strength strongly correlated (or perfectly correlated with key length)? Say we have two algorithms, A and B with key sizes of 128 and 160 bits (the common measure) Is A less secure than B? What if A=B (for variable key-length algorithms)? Terminology: key length is the security parameter. 12

Is there an unbreakable cipher? As it turns out, yes. (Claude Shannon proved it) 13

The one-time pad (OTP) Assume you have a secret bit string s of length n known only to two parties, Alice and Bob Alice sends a message m of length of n to Bob Alice uses the following encryption function to generate n ciphertext bits: i=0 c i = m i k i E.g., XOR the data with the secret bit string An adversary Mallory cannot retrieve any part of the data Simple version of the proof of security: Assume for simplicity that value of each bit in m is equally likely, then you have no information to work with. 14

Data Encryption Standard (DES) Introduced by the US NBS (now NIST) in 1972 Signaled the beginning of the modern area of cryptography Block cipher Fixed sized input 8-byte input and a 8-byte key (56-bits+8 parity bits) 15

Breaking Ciphers Brute force cryptanalysis Just keep trying different keys and check result (early breaks) Linear cryptanalysis Construct linear equations relating plaintext, ciphertext and key bits that have a high bias; that is, whose probabilities of holding (over the space of all possible values of their variables) are as close as possible to 0 or 1 Use these linear equations in conjunction with known plaintext-ciphertext pairs to derive key bits. Differential cryptanalysis study of how differences in an input can affect the resultant difference at the output (showing non-random behavior) Use chosen plaintext to uncover key bits 16

Substitution Box (S-box) A substitution box (or S-box) is used to obscure the relationship between the plaintext and the ciphertext Shannon's property of confusion: the relationship between key and ciphertext is as complex as possible. In DES S-boxes are carefully chosen to resist cryptanalysis. Thus, that is where the security comes from. Example: Given a 6-bit input, the 4-bit output is found by selecting the row using the outer two bits, and the column using the inner four bits. For example, an input "011011" has outer bits "01" and inner bits "1101"; the corresponding output would be "1001". 17

Cryptanalysis of DES DES has an effective 56-bit key length Wiener: $1,000,000-3.5 hours (never built) July 17, 1998, the EFF DES Cracker, which was built for less than $250,000 < 3 days January 19, 1999, Distributed.Net (w/eff), 22 hours and 15 minutes (over many machines) We all assume that NSA and agencies like it around the world can crack (recover key) DES in milliseconds What now? Give up on DES? 18

Variants of DES DESX (XOR with separate keys ~= 60-bits) Linear cryptanalysis Triple DES (three keys ~= 112-bits) keys k 1,k 2,k 3 C = E(D(E(p, k 1 ),k 2,k 3 ) k 1 k 2 k 3 p E D E c 19

Advanced Encryption Standard (AES) International NIST bakeoff between cryptographers Rijndael (pronounced Rhine-dall ) Replacement for DES/accepted symmetric key cipher Substitution-permutation network, not a Feistel network Variable key lengths Fast implementation in hardware and software Small code and memory footprint 20

Public Key Cryptography Public Key cryptography Each key pair consists of a public and private component: k + (public key), k - (private key) D(E(p, k + ),k )=p D(E(p, k ),k + )=p Public keys are distributed (typically) through public key certificates Anyone can communicate secretly with you if they have your certificate E.g., SSL-based web commerce 21

Hash Algorithms Hash algorithm Compression of data into a hash value E.g., h(d) = parity(d) Such algorithms are generally useful in algorithms (speed/space optimization) as used in cryptosystems One-way - (computationally) hard to invert h(), i.e., compute h -1 (y), where y=h(d) Collision resistant hard to find two data x 1 and x 2 such that h(x 1 ) == h(x 2 ) Q: What can you do with these constructs? 22

Hash Functions Design a strong cryptographic hash function No formal basis Concern is backdoors MD2 Substitution based on pi MD4, MD5 Similar, but complex functions in multiple passes SHA-1 160-bit hash Complicated function 23

Message Authentication Code MAC Used in protocols to authenticate content, authenticates integrity for data d To simplify, hash function h(), key k, data d MAC(k, d) =h(k d) E.g., XOR the key with the data and hash the result Q: Why does this provide integrity? Cannot produce mac(k,d) unless you know k and d If you could, then can invert h() 24

HMAC MAC that meets the following properties Collision-resistant Attacker cannot computer proper digest without knowing K Even if attacker can see an arbitrary number of digests H(k+x) Simple MAC has a flaw Block hash algorithms mean that new content can be added Turn H(K+m) to H(K+m+m ) where m is controlled by an attacker HMAC(K, d) = H(K + H(K + d)) Attacker cannot extend MAC as above Prove it to yourself 25

Birthday Attack A birthday attack is a name used to refer to a class of brute-force attacks. birthday paradox : the probability that two or more people in a group of 23 share the same birthday is >than 50% General formulation function f() whose output is uniformly distributed On repeated random inputs n = { n 1, n 2,,.., n k } Pr(n i = n j ) = 1.2k 1/2, for some 1 <= i,j <= k, 1 <= j < k, i!= j E.g., 1.2(365 1/2 ) ~= 23 Q: Why is resilience to birthday attacks important? 26

Using hashes as authenticators Consider the following scenario Prof. Alice has not decided if she will cancel the next lecture. When she does decide, she communicates to Bob the student through Mallory, her evil TA. She does not care if Bob shows up to a cancelled class Alice does not trust Mallory to deliver the message. She and Bob use the following protocol: 1. Alice invents a secret t 2. Alice gives Bob h(t), where h() is a crypto hash function 3. If she cancels class, she gives t to Mallory to give to Bob If does not cancel class, she does nothing If Bob receives the token t, he knows that Alice sent it 27

Hash Authenticators Why is this protocol secure? t acts as an authenticated value (authenticator) because Mallory could not have produced t without inverting h() Note: Mallory can convince Bob that class is occurring when it is not by simply not delivering h(t) (but we assume Bob is smart enough to come to that conclusion when the room is empty) What is important here is that hash preimages are good as (single bit) authenticators. Note that it is important that Bob got the original value h(t) from Alice directly (was provably authentic) 28

Hash chain Now, consider the case where Alice wants to do the same protocol, only for all 26 classes (the semester) Alice and Bob use the following protocol: 1.Alice invents a secret t 2.Alice gives Bob H 26 (t), where H 26 () is 26 repeated uses of H(). 3.If she cancels class on day d, she gives H (26-D) (t) to Mallory, e.g., If cancels on day 1, she gives Mallory H 25 (t) If cancels on day 2, she gives Mallory H 24 (t). If cancels on day 25, she gives Mallory H 1 (t) If cancels on day 26, she gives Mallory t 4.If does not cancel class, she does nothing If Bob receives the token t, he knows that Alice sent it 29

Hash Chain (cont.) Why is this protocol secure? On day d, H (26-d) (t) acts as an authenticated value (authenticator) because Mallory could not create t without inverting H() because for any H k (t) she has k>(26-d) That is, Mallory potentially has access to the hash values for all days prior to today, but that provides no information on today s value, as they are all post-images of today s value Note: Mallory can again convince Bob that class is occurring by not delivering H (26-d) (t) Chain of hash values are ordered authenticators Important that Bob got the original value H 26 (t) from Alice directly (was provably authentic) 30

Basic truths of cryptography Cryptography is not frequently the source of security problems Algorithms are well known and widely studied Use of crypto commonly is (e.g., WEP) Vetted through crypto community Avoid any proprietary encryption Claims of new technology or perfect security are almost assuredly snake oil 31

Common issues that lead to pitfalls Generating randomness Storage of secret keys Virtual memory (pages secrets onto disk) Protocol interactions Poor user interface Poor choice of key length, prime length, using parameters from one algorithm in another 32