Block Ciphers (Crypto 2)

Slides:



Advertisements
Similar presentations
“Advanced Encryption Standard” & “Modes of Operation”
Advertisements

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
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.
Lecture 23 Symmetric Encryption
Block Cipher Transmission Modes CSCI 5857: Encoding and Encryption.
CSCI 5857: Encoding and Encryption
Modes of Operation. Topics  Overview of Modes of Operation  EBC, CBC, CFB, OFB, CTR  Notes and Remarks on each modes.
Chapter 20 Symmetric Encryption and Message Confidentiality.
Lecture 4: Using Block Ciphers
TE/CS 536 Network Security Spring 2006 – Lectures 6&7 Secret Key Cryptography.
Chapter 20 Symmetric Encryption and Message Confidentiality.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Block ciphers Structure of a multiround block cipher
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
3DES and Block Cipher Modes of Operation CSE 651: Introduction to Network Security.
Chapter 2 (B) – Block Ciphers and Data Encryption Standard.
1.1 Chapter 8 Encipherment Using Modern Symmetric-Key Ciphers Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Modes of Usage Dan Fleck CS 469: Security Engineering These slides are modified with permission from Bill Young (Univ of Texas) 11 Coming up: Modes of.
Stream Ciphers and Block Ciphers A stream cipher is one that encrypts a digital data stream one bit or one byte at a time. Examples of classical stream.
1 University of Palestine Information Security Principles ITGD 2202 Ms. Eman Alajrami 2 nd Semester
Lecture 23 Symmetric Encryption
Chapter 2 Symmetric Encryption.
Cipher Transmission and Storage Modes Part 2: Stream Cipher Modes CSCI 5857: Encoding and Encryption.
Module :MA3036NI Symmetric Encryption -3 Lecture Week 4.
Block Ciphers and the Data Encryption Standard. Modern Block Ciphers  One of the most widely used types of cryptographic algorithms  Used in symmetric.
Block Cipher Modes Last Updated: Aug 25, ECB Mode Electronic Code Book Divide the plaintext into fixed-size blocks Encrypt/Decrypt each block independently.
Modes of Operation block ciphers encrypt fixed size blocks – eg. DES encrypts 64-bit blocks with 56-bit key need some way to en/decrypt arbitrary amounts.
CS480 Cryptography and Information Security
Modes of Operation.
Algorithm Modes ECB, CBC, CFB, OFB.
Computer and Network Security
Provides Confidentiality
CSCE 715: Network Systems Security
(Data Encryption Standard)
Network Security.
6b. Practical Constructions of Symmetric-Key Primitives.
Outline Desirable characteristics of ciphers Stream and block ciphers
Block Cipher Modes CS 465 Make a chart for the mode comparisons
Cryptography and Network Security Chapter 3
CS/ECE 478 Dr. Attila Altay Yavuz
Cryptography Lecture 16.
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
Block cipher and modes of encryptions
PART VII Security.
Cryptography and Network Security
ICS 454: Principles of Cryptography
Algorithm Types & Algorithm Modes
Block vs Stream Ciphers
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Foundations of Network and Computer Security
Chapter -2 Block Ciphers and the Data Encryption Standard
Network Security.
Block Ciphers: DES and AES
SYMMETRIC ENCRYPTION.
Padding Oracle Attacks
Lecture 4.1: Hash Functions, and Message Authentication Codes
Encryption Basics Types of ciphers Algorithms Modes Key Length
Cryptography Lecture 16.
ICS 555: Block Ciphers & DES Sultan Almuhammadi.
CRYPTOGRAPHY & NETWORK SECURITY
Counter Mode, Output Feedback Mode
Elect. Codebook, Cipher Block Chaining
Feistel Cipher Structure
Simple Hash Functions Network Security.
Review of Cryptography: Symmetric and Asymmetric Crypto Advanced Network Security Peter Reiher August, 2014.
Secret-Key Encryption
Presentation transcript:

Block Ciphers (Crypto 2)

In This Talk (I promise there won’t be any math) Block Ciphers Encryption Modes Padding Schemes

What is a block cipher?

What is a block cipher? A bijective function with 2 inputs Fixed amount of data A secret key Key specifies a transformation

What do we look for in a block cipher?

What do we look for in a block cipher? Models a pseudorandom function What is a pseudorandom function? Models a random function, with a seed Key is the seed Small change in input -> Large change in output Duality: Substitution and Permutation Confusion and Diffusion

What can’t a block cipher do? Provide Authenticity Provide Nonrepudiation Provide Integrity Encrypt >1 block of data Encrypt <1 block of data

Important Block ciphers are building blocks for more general cryptographic purposes “Primitive” Not very useful on their own

Some block cipher constructions Substitution/Permutation Network Feistel Network ARX

Substitution/Permutation Network Substitution: Confusion Permutation: Diffusion Each round has fixed substitutions and permutations Simple to implement Slow

Feistel Networks Each round operate on the left half Key and right half are inputs to F-box F-box need not be invertible XOR those together, new right Old right is new left Repeat many times with different keys each round

Feistel Networks Why is decryption invertible? Why does F not need to be invertible?

Feistel Networks Speed depends on F F is flexible Need a certain amount of rounds minimum Needs more rounds because only operating on half of data

ARX Argument is you only need 3 basic mathematical operations Add Rotate XOR Ridiculously fast in hardware

Some common block ciphers DES - Old standard, not used much because of small block/key size 64 bit block, 56 bit key feistel AES - Current standard 128 bit block, 128+ bit key Sub/Perm Network Salsa20 - another alternative ARX network Immune to timing attacks

CTF Rule of Thumb If they import it, assume secure If it’s custom, it is exploitable

Encrypting more than one block of data If you have some multiple of the length of the data Still fixed key Same concept as block ciphers: small change in input should bring large changes in output In fact, they are even better - no change in input brings large changes in output Don’t compromise security - security is as good as the block cipher

How? Probabilistic Encryption - plaintext is not always encrypted the same way Deterministic Decryption - ciphertext is always decrypted the same way For any message M, D(E(M)) = M (always) Randomly generate an Initialization Vector (IV) Since this will be different each time, blocks will encrypt differently IV needs to be accounted for when decrypted

Electronic Codebook Mode Everyone’s favorite terrible example of encryption For each block, decrypt as a normal block cipher Why is this bad?

Cipher Block Chaining Idea: At each round, XOR with previous round’s ciphertext C0 = IV If previous round is changed, so is next Decrypt ciphertext by XORing decrypted blocks with previous ciphertext What if attacker controls ciphertext?

CBC Diagrams

Attacking CBC Assume part of plaintext is known Use the previous block to control the known plaintext

Attacking CBC For known plaintext block i E-1(ci) ⊕ ci-1 = pi

Counter mode of operation Use IV as input into block cipher Increment IV each time Create a stream not dependent on the ciphertext (parallelization) My go-to mode of operation Still vulnerable if IV reuse allowed in decryption

CTR Diagrams

Padding Methods to allow us to encrypt arbitrary length messages Padding itself needs to be reversible Padding/unpadding only determined by the length

Explicit Padding Part of the pad explicitly states the length of the pad Usually the last byte Easy to check But gives information about the plaintext Possible to be manipulated

Types of explicit padding Assume p bytes need to be padded Random method p -1 random/arbitrary bytes, then last byte is p Worst security, only need to manipulate one byte 0 method p -1 null bytes, then last byte is p Harder because you need to set those bytes to 0

Types of explicit padding PKCS7 Last p bytes are p Harder because bytes are changing as p changes

Padding Oracle attacks A CBC padding oracle with explicit padding means any ciphertext can be decrypted An “oracle” is some online function or method we can query that returns to us some result A padding oracle only tells us whether the padding is legal or illegal CBC encryption scheme is necessary for this to work, the block cipher itself doesn’t matter If we have a valid ciphertext, it will have valid padding

Padding Oracle attacks Manipulate the last byte - this will produce invalid paddings except… Once you know the last byte, manipulate it to “\x02” and manipulate second to last byte Repeat for entire ciphertext!

Implicit Padding Padding schemes that don’t say the amount of padding After the message, append a 1 bit then 0 bits until full Since we usually operate on bytes, this will be “\x80” then null bytes until full

No padding Ciphertext Stealing Streaming modes of encryption (CTR) Stream Ciphers

Sources Diagrams from wikipedia