CIT 480: Securing Computer Systems

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

“Advanced Encryption Standard” & “Modes of Operation”
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Introduction to Symmetric Block Cipher Jing Deng Based on Prof. Rick Han’s Lecture Slides Dr. Andreas Steffen’s Security Tutorial.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering.
Computer Networking Lecture 21: Security and Cryptography Thanks to various folks from , semester’s past and others.
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
CS426Fall 2010/Lecture 21 Computer Security CS 426 Lecture 2 Cryptography: Terminology & Classic Ciphers.
Lecture 23 Symmetric Encryption
What is Cryptography? Definition: The science or study of the techniques of secret writing, esp. code and cipher systems, methods, and the like Google.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Computer Security CS 426 Lecture 3
L1.1. An Introduction to Classical Cryptosystems Rocky K. C. Chang, February 2013.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
symmetric key cryptography
Contact Information Cryptography 8/10/2015 | pag. 2 Professor Assistant Office Webpage Course Text Ann Dooms Adriaan Barri
Chapter 20 Symmetric Encryption and Message Confidentiality.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Lec. 5 : History of Cryptologic Research II
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Classical Cryptography.
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
Chapter 20 Symmetric Encryption and Message Confidentiality.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Classical Crypto By: Luong-Sorin VA, IMIT Dith Nimol, IMIT.
Part 9, Basic Cryptography 1. Introduction A cryptosystem is a tuple: ( M,K,C, E,D) where M is the set of plaintexts K the set of keys C the set of ciphertexts.
Traditional Symmetric-Key Ciphers
September 10, 2009Introduction to Computer Security ©2004 Matt Bishop Slide #8-1 Chapter 8: Basic Cryptography Classical Cryptography Public Key Cryptography.
Computer Security Cryptography. Cryptography Now and Before  In the past – mainly used for confidentiality  Today –Still used for confidentiality –Data.
Lecture 23 Symmetric Encryption
K. Salah1 Cryptography Module I. K. Salah2 Cryptographic Protocols  Messages should be transmitted to destination  Only the recipient should see it.
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
EEC 688/788 Secure and Dependable Computing Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Lecture 5 Page 1 CS 236 Online More on Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
Department of Computer Science Chapter 5 Introduction to Cryptography Semester 1.
1 Introduction to Cryptography Chapter-4. Definitions  Cryptography = the science (art) of encryption  Cryptanalysis = the science (art) of breaking.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Classical Cryptography.
Lecture 4 Data Encryption Standard (DES) Dr. Nermin Hamza
CRYPTOGRAPHY G REEK WORD MEANING “ SECRET WRITING ”
CIT 380: Securing Computer Systems
Chapter 2 Basic Encryption and Decryption
IT443 – Network Security Administration Instructor: Bo Sheng
Outline Desirable characteristics of ciphers Uses of cryptography
Chapter 30 Cryptography Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Cryptography.
Outline Desirable characteristics of ciphers Uses of cryptography
Lecture 3: Symmetric Key Encryption
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
Security through Encryption
PART VII Security.
Block vs Stream Ciphers
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
SYMMETRIC ENCRYPTION.
Elect. Codebook, Cipher Block Chaining
Stream Cipher Structure
Secret-Key Encryption
Presentation transcript:

CIT 480: Securing Computer Systems Symmetric Cryptography

Topics Modular Arithmetic Transposition Ciphers Substitution Ciphers Cryptanalysis: frequency analysis Block Ciphers AES and DES Stream Ciphers Random Number Generation

Modular Arithmetic Congruence b is the residue of a, modulo N a = b (mod N) iff a = b + kN ex: 37=27 mod 10 b is the residue of a, modulo N Integers 0..N-1 are the set of residues mod N Modulo 12 number system

Terminology Plaintext: message P to be encrypted. Also called cleartext. Encryption: altering a message to keep its contents secret. Ciphertext: encrypted message C. Plaintext Ciphertext Encryption Procedure

Cæsar cipher Plaintext is HELLO WORLD Change each letter to the third letter following it (X goes to A, Y to B, Z to C) Key is 3, usually written as letter ‘D’ Ciphertext is KHOOR ZRUOG

ROT 13 Cæsar cipher with key of 13 13 chosen since encryption and decryption are same operation Used to hide spoilers, punchlines, and offensive material online.

Kerckhoff’s Principle Security of cryptosystem should only depend on Quality of shared encryption algorithm E Secrecy of key K Security through obscurity tends to fail ex: DVD Content Scrambling System http://www.math.ucsd.edu/~crypto/Projects/MarkBarry/index.htm

Cryptanalysis Goals Decrypt a given message. Recover encryption key. Threat models vary based on Type of information available to adversary Interaction with cryptosystem.

Cryptanalysis Threat Models ciphertext only: adversary has only ciphertext; goal is to find plaintext, possibly key. known plaintext: adversary has ciphertext, corresponding plaintext; goal is to find key. chosen plaintext: adversary may supply plaintexts and obtain corresponding ciphertext; goal is to find key.

Brute Force Attack Example: DES has 56-bit keys Exhaustive search of keyspace by decrypting ciphertext C with all possible keys K. Must determine if DK(C) is a likely plaintext Requires some knowledge of format (language, doc type) For N possible keys, Worst case is N decryptions. Mean case is N/2 decryptions. Example: DES has 56-bit keys Average time to find key is 255 decryptions.

Is 128 bits enough? 128-bit keyspace permits 2128 keys 340,282,366,920,938,463,463,374,607,431,768,211,456 or 3.4 x 1038 keys Cracking 1 trillion (1012) keys per second requires 3.4 x 1026 seconds or 1.08 x 1019 years Cracking 1 trillion keys per second on 1 billion CPUs requires 1.08 x 1010 years = 10.8 billion years

Classical Cryptography Sender and receiver share common key Keys may be the same, or be trivial to derive from one another. Sometimes called symmetric cryptography. C P encrypt K decrypt

Brute Force vs. Cæsar Cipher Brute Force attack Only 26 possible keys. PC can try all in <1s. Decryption key (26-K) Candidate plaintext exxegoexsrgi 1 dwwdfndwrqfh 2 cvvcemcvqpeg 3 buubdlbupodf 4 attackatonce 5 zsszbjzsnmbd 6 yrryaiyrmlac ... 23 haahjrhavujl 24 gzzgiqgzutik 25 fyyfhpfytshj

General Simple Substitution Cipher Keys: All permutations of alphabet (26! keys) Encryption: Replace each plaintext letter x with K(x) Decryption: Replace each ciphertext letter y with K-1(y) Example: 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 K= F U B A R D H G J I L K N M P O S Q Z W X Y V T C E CRYPTO BQCOWP

General Simple Substitution Security Exhaustive search impossible Key space size is 26! =~ 4 x 1026 Historically thought to be unbreakable. However, languages have different frequencies of letters digraphs (groups of 2 letters) trigraphs (groups of 3 letters) etc. Simple substitution ciphers preserve letter frequencies.

English Letter Frequencies

Additional Frequency Features Digraph frequencies Common digraphs: EN, RE, ER, NT Trigraph frequencies Common trigraphs: THE, AND, ING Digraph and trigraph tables can be found at http://www.sttmedia.com/syllablefrequency-english The letter Q is followed only by U.

Countering Frequency Analysis Primary weakness of simple substitution: Each ciphertext letter corresponds to only one letter of plaintext. Solution: polyalphabetic substitution Use multiple cipher alphabets. Switch between cipher alphabets from character to character in the plaintext.

Vigènere Cipher Use phrase instead of letter as key. Example Message THE BOY HAS THE BALL Key VIG Encipher using Cæsar cipher for each letter: key VIGVIGVIGVIGVIGV plain THEBOYHASTHEBALL cipher OPKWWECIYOPKWIRG http://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher Reproduction of CSA Cipher Disk

Letter Frequency Distributions

One-Time Pad A Vigenère cipher with a random key at least as long as the message. Provably unbreakable. Example ciphertext: DXQR. Equally likely to correspond to plaintext DOIT (key AJIY) plaintext DONT (key AJDY) and any other 4 letters. http://en.wikipedia.org/wiki/One_time_pad

Binary One Time Pad Encrypt a message M with pad P to produce ciphertext C = M ⊕ P where ⊕ is the exclusive OR operator. Decrypt a ciphertext C with the same pad P M = C ⊕ P

One Time Pad Problems The one-time pad must be random. Software pseudo-random number generators are not random. Pad needs hardware randomness. Transmission of long pads is difficult. The pad is just as long as all the messages you’ll ever send with it, so you’ve just moved the problem of transmitting secret messages to transmitting a secret pad. Pad must always be kept secret. If pad is ever discovered, then attacker can decrypt old messages. Pads must be securely destroyed at end of use.

Block Ciphers Encrypt groups (blocks) of chars at once. Improvement over single char substitution Cryptanalysis must use digraph frequencies for two-char blocks. Longer blocks are more difficult to analyze. Modern ciphers are block ciphers. Example: Playfair Cipher, 1854

DES is Insecure Brute force attacks can be completed in <1 day. Distributed computing attacks. RIVYERA FPGA-based parallel computer breaks DES in <1 day for a hardware cost of <$10,000. Linear cryptanalysis faster than brute force Need 241 known plaintexts https://de.wikipedia.org/wiki/Copacobana is RIVYERA’s predecessor

Triple DES Encrypt-Decrypt-Encrypt Mode (3 keys: k, k´, k´´) c = DESk(DESk´–1(DESk’’(m))) Middle decrypt allows backward compatibility if all keys are equal: k = k´= k´´ Double-encryption vulnerable to meet-in-middle attack, reducing difficulty from 2112 to 257.

Advanced Encryption Standard (AES) Winner of open NIST competition (1997-2000) Rijndael, designed by Joan Daemen and Vincent Rijmen. Published as FIPS 197 in November 2001. 128-bit block cipher 128-, 192-, or 256-bit keys. 10, 12, or 14 rounds, depending on key size. Replacement for DES DES vulnerable to brute force attacks due to 56-bit keys. Triple DES is very slow.

Electronic Code Book Mode Encrypt each block independently. E(block) = Cblock each time block appears Therefore attacker can build dictionary of blocks. https://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 ECB encryption of bitmap hides colors but image is still discernible.

Cipher Block Chaining Mode XOR each block with previous ciphertext block. Random initialization vector (IV) used for 1st. https://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 CBC encryption of bitmap looks random.

Stream Ciphers Combine plaintext with cipher bitstream Cipher generates stream of pseudo-random bits Loosely inspired by one time pad. RC4 is most widely used stream cipher Variable length key: 40 to 128 bits Aircrack breaks 104-bit RC4 used in WEP in 1min No known practical attacks against 128-bit, but Much speculation that NSA can crack 128-bit RC4. Block cipher to stream cipher Using block cipher in Counter Mode. XOR counter mode data with plaintext.

Importance of RNGs We need all those brilliant Belgian cryptographers to go "alright we know that these encryption algorithms we are using today work, typically it is the random number generators that are attacked as opposed to the encryption algorithms themselves. How can we make them [secure], how can we test them?“ -- Ed Snowden at SXSW

Key Generation Goal: Ensure best attack against cipher is brute force. Solution: Given set of K potential keys, choose one randomly. Selecting a random number between 0 and K–1. Ex: For a 128-bit key, select number between 0 and 2128-1 Difficulty: generating random numbers Hardware random number generators gather entropy from physical world but are expensive and limited in how many bits/second they product. Software generated numbers are pseudo-random (PRNGs), that is, generated by an algorithm. If starting with same seed, then PRNGs will produce the same sequence of numbers each time.

Secure PRNGs Cryptographically Secure PRNGs (CSPRNGs) must: Statistically appear random. Difficult to predict next member of sequence from previous members. Difficult to extract internal state of PRNG from observing output. May be re-seeded at runtime, unlike PRNGs.

Yarrow Yarrow is named after plant whose leaves are used in I Ching divination. Used for /dev/random in FreeBSD and Mac OS X. Steps Accumulates entropy from system sources. Pools are SHA-1 hash contexts, 160 bits maximum. Reseeds generator with key made from pool entropy to limit state compromise attacks. Generates numbers using Triple-DES in counter mode. https://www.schneier.com/yarrow.html https://www.schneier.com/paper-yarrow.pdf

Ivy Bridge RNG Added with Ivy Bridge Core iN CPUs in 2012. One RNG per die, not per core. Entropy source is thermal noise. http://electronicdesign.com/learning-resources/understanding-intels-ivy-bridge-random-number-generator

Key Points: Cryptography Types of ciphers Substitution (monoalphabetic and polyalphabetic) Transposition (permutation) Product (Substitution + Permutation) Cryptanalysis Kerchoff’s principle Brute force attack Find key in at most n tries, for n possible keys. Find key in an average of n/2 tries. A cryptosystem with x-bit keys has 2x possible keys. Frequency analysis. One-time pad is provably secure Block ciphers ECB mode insecure; need to use CBC for block ciphers. DES obsolete due to small 56-bit keys. 3DES=112 bit key. AES current standard, best symmetric cipher is AES-128.

Key Points: RNGs Secure keys must be randomly generated. RNG types Hardware: physical entropy software, which is often used as a seed for the software RNGs. PRNG: algorithmic generation of predictable but statistically random number sequences. Example: LCG. CSPRNG: PRNG where it is difficult to predict next number of extract PRNG state. Example: Yarrow. PRNG features Periodic: sequence will eventually repeat. Seed-dependent: seed determines starting point of sequence; if seed is identical in two runs, sequence is identical.

References Ross Anderson, Security Engineering, 2nd edition, Wiley, 2008. Matt Bishop, Introduction to Computer Security, Addison-Wesley, 2005. Neil Daswani et. al., Foundations of Security, Apress, 2007. Goodrich and Tammasia, Introduction to Computer Security, Pearson, 2011. David Kahn, The Codebreakers, MacMillan, 1967. Alfred J. Menezes, Paul C. van Oorschot and Scott A. Vanstone, Handbook of Applied Cryptography, http://www.cacr.math.uwaterloo.ca/hac/, CRC Press, 1996. NIST, FIPS Publication 46-3: Data Encryption Standard (DES), 1999, http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf Bruce Schneier, Applied Cryptography, 2nd edition, Wiley, 1996. US Government Dept of the Army, FM 34-40-2 FIELD MANUAL, 1990, http://www.umich.edu/~umich/fm-34-40-2/