SlideShare a Scribd company logo
1 of 55
Download to read offline
CNIT 141
Cryptography for Computer Networks
8. Authenticated Encryption
MAC v. AE
• Message Authentication Code (MAC)
• Protects a message's authenticity
• With a tag, like a signature
• But doesn't provide confidentiality
• Authenticated Encryption (AE)
• Produces an authentication tag
• And also encrypts the message
• Combining a cipher and a MAC
Topics
• Authenticated Encryption using MACs
• Authenticated Ciphers
• AES-GCM: The Authenticated Cipher Standard
• OCB: An Authenticated Cipher Faster than
GCM
• SIV: The Safest Authenticated Cipher?
• Permutation-Based AEAD
• How Things Can Go Wrong
Authenticated Encryption
using MACs
Three Ways
Encrypt-and-MAC
• Least secure system
• MAC might leak information about P
• Because MACs are only required to
be unforgeable, not random
• Used by SSH
SSH
• Each encrypted packet C
• Is followed by the tag
T = MAC(K, N || P)
N is a sequence number
• Secure in practice because the
MAC algorithms are strong and
don't leak information
• Like HMAC-SHA-256
Mac-then-Encrypt
• First compute the tag
• T = MAC(K2, P)
• Then create ciphertext
• C = E(K1, P || T)
• More secure than encrypt-and-MAC
• Hides plaintext tag, so it can't leak
information about the plaintext
• Used by TLS until version 1.3
Encrypt-then-MAC
• Sends two values
• Ciphertext C = E(K1, P)
• Tag T = MAC(K2, C)
• Strongest system
• Used by IPSec
Authenticated Ciphers
What is an
Authenticated Cipher?
• Different from combining cipher and MAC
• Like a normal cipher, but
• Returns an authentication tag along with
ciphertext
• AE(K,P) = (C, T)
• Decryption
• AD(K, C, T) = P
Security Requirements
• Authentication should be as strong as a MAC
• Impossible to forge a (C,T) pair
• That the AD function will accept and decrypt
• Confidentiality is stronger than a basic cipher
• Decryption will fail unless the tag is valid
• Prevents chosen-ciphertext attacks
Authenticated Encyption with
Associated Data (AEAD)
• Associated data is authenticated by the tag
• But not encrypted
• Example: network header data
• AEAD(K, P, A) = (C, A, T)
• Tag depends on both P and A
• Will be rejected if C or A is modified
• You can leave A or P empty
Authenticated Encyption with
Associated Data (AEAD)
• You can leave A or P empty
• If A is empty, AEAD is AE
• If P is empty, AEAD is MAC
Avoiding Predictability with
Nonces
• Use AE(K, P, A, N)
• N is nonce and must not be re-used with the
same key
What Makes a Good
Authenticated Cipher?
Security Criteria
• Confidentiality must be as strong as the best
cipher
• Authenticity must be as strong as the best
MAC
• Fragility if nonce is repeated (misuse
resistance)
• Parallelizability -- can process multiple blocks
simultaneously
• CTR is parallelizable, CBC is not
Performance Criteria
• Internal structure
• Two-layer, like AES-CGM,
• First layer is encryption of plaintext
• Second layer is authentication
• One-layer may be simpler and faster
Performance Criteria
• Streamable (aka online)
• Can process a message block by block
• Discarding completed blocks
• Reduces RAM requirements
• Nonstreamable ciphers must store the entire
message
• Typically because they must make two
passes over the data
Performance Criteria
• Other features of implementation
• Some AC only allow A to precede P
• Others place it after, or anywhere
• Some systems, like AES-CBC, requre two
algorithms, one for encryption and one for
decryption
• AES-CTR can use the same algorithm for both
• Cost may matter on low-cost dedicated
hardware
Functional Criteria
AES-GCM:
The Authenticated Cipher Standard
AES-GCM
• AES algorithm
• Galois Counter Mode (GCM)
• A tweak of CTR mode
• Uses a small, efficient algorithm to compute
an authentication tag
AES-GCM
• The most widely used authenticated cipher
• The only authenticated cipher that is a NIST
standard
• Part of NSA's Suite B
• Used in IPSec, SSH, and TLS 1.2
• Encrypt-then-MAC
• K is 128 bits
• N is 96 bits
• Uses "polynomial
multiplication" with
hash key H
GCM Security
• Fragile when nonce is repeated
• If nonce is used twice, attacker can get
authentication key H
• And forge tags
• In 2016, 184 HTTPS servers were found with
repeated nonces
• Including 23 using all-zeroes
GCM Efficiency
• GCM encryption and decryption are both
parallelizable
• But the MAC is not
• GCM is streamable
• Because the layers can be pipelined
• Processing blocks one by one
OCB: An Authenticated
Cipher Faster than GCM
Offset Codebook
• Developed in 2001
• Faster and simpler than GCM
• Limited by license until 2013
• Blends encryption and authentication into one
layer
• With only one key
OCB Internals
• Each block of plaintext is encrypted with a
block cipher
• With a key and an Offset computed from the
key and a nonce that increments for each block
OCB Internals
• Tag uses S = P1 ^ P2 ^ P3
• XORs S with an offset computed from the last
block's offset
OCB
• Support associated data also
• With offset values that are different than those
used to encrypt P
OCB Security
• Less fragile than GCM against repeated
nonces
• Attackers will see identical blocks of
ciphertext, like ECB
• But won't be able to find the secret key
OCB Efficiency
• OCB and GCM are about equally fast
• Both are parallelizable and streamable
• On early Intel processors, AES-GCM used to
be three times slower than AES-OCB
• Because the GHASH calculation is slower than
the XORs used by OCB
• GCM uses the same function for encryption and
decryption
• OCB requires two functions
SIV: The Safest
Authenticated Cipher?
Synthetic IV (SIV)
• An authenticated cipher mode
• Typically used with AES
• Secure even if you use the same nonce twice
• Unlike GCM and OCB
• Attacker will only learn that the same
plaintest was encrypted twice
SIV Construction
• Combine encryption function E
• And a pseudorandom function PRG
• Using two keys K1 and K2
• And a nonce N
• Tag: T = PRF(K1, N||P)
• Ciphertext: C = E(K2, T, P)
• T acts as the nonce of E
SIV Performance
• SIV is not streamable
• After computing T, it must keep the entire
plaintext P in memory
• To encrypt 100 GB of plaintext, you must
store 100 GB
Permutation-Based AEAD
Permutation
• Not a block cipher like AES
• Simply transforms input to output of the same
size
• Reversibly, without using a key
• Fast, secure, and more resistant to nonce
reuse than GCM and OCB
Permutation-Based AEAD
• Start with initial state H0
• XOR with key K and nonce N
• Permute with P to get new internal state
Permutation-Based AEAD
• This produces a series of pseudorandom
blocks
• XOR them with plaintext blocks to form
ciphertext blocks
Permutation-Based AEAD
• Ciphertext is same length as plaintext
• Internal state is larger than block size
• Bits from last internal state form the tag
Permutation-Based AEAD
Security
• Security relies on secrecy of the internal state
• Blocks must be padded carefully
• Nonce re-use is only a small problem
• Attacker can only tell that messages began
with same value
Permutation-Based AEAD
Performance
• A single layer of operations
• Streamable
• A single core algorithm for encryption and
decryption
• But not parallelizable like GCM or OCB
• New calls to P must wait for previous call to
complete
How Things Can Go
Wrong
Attack Surface
• Authenticated ciphers must provide both
confidentiality and authenticity
• Take two values: plaintext P and associated
data A
• Must remain secure for all values of P and A
• Even when one is absent, all zeroes, or very
large
Attack Surface
• Must remain secure against attackers who
collect numerous message/tag pairs
• And against accidental repetition of nonces
AES-GCM and Weak
Hash Keys
• GHASH uses a hash key H over and over for
each block
• Certain values of H make the tag weak
• Because they form a "short cycle" and
repeat every few blocks
Tag Forgery
• If H has a cycle of five
• An attacker could swap the first and sixth
block of ciphertext
• And get the same authentication tag
• Constructing a new valid message without
knowing the key
Consqeuences of Tag
Forgery
• To become
root, swap
second and
sixth block
• Changes uid
to 1
AES-GCM and Weak
Hash Keys
• Not practical to exploit
• Attacker needs to know H or K to find cycle
length
• But still a defect of AES-GCM
AES-GCM and Small Tags
• Normally returns 128-bit tags
• Those are secure
• But can produce shorter tags, like 32 or 48 bits
• Those are much weaker than they appear, for
long messages
• 48-bit tags for messages 4 GB long
• Have one chance in a million of a forgery
succeeding
CNIT 141: 8. Authenticated Encryption

More Related Content

What's hot

Proposed Lightweight Block Cipher Algorithm for Securing Internet of Things
Proposed Lightweight Block Cipher Algorithm for Securing Internet of ThingsProposed Lightweight Block Cipher Algorithm for Securing Internet of Things
Proposed Lightweight Block Cipher Algorithm for Securing Internet of ThingsSeddiq Q. Abd Al-Rahman
 
Post Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical OverviewPost Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical OverviewRamesh Nagappan
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream CiphersSam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Mazin Alwaaly
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsSam Bowne
 
Authenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmAuthenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmVittorio Giovara
 
Blockchaindev #1 - Ethereum Smart Contracts 101
Blockchaindev #1 - Ethereum Smart Contracts 101Blockchaindev #1 - Ethereum Smart Contracts 101
Blockchaindev #1 - Ethereum Smart Contracts 101Thiago Araujo
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingSam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam Bowne
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic EncryptionVipin Tejwani
 
CNIT 141 13. TLS
CNIT 141 13. TLSCNIT 141 13. TLS
CNIT 141 13. TLSSam Bowne
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network SecurityRamki M
 
Cryptography Fundamentals
Cryptography FundamentalsCryptography Fundamentals
Cryptography FundamentalsDuy Do Phan
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic EncryptionGöktuğ Serez
 
CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)Sam Bowne
 

What's hot (20)

Proposed Lightweight Block Cipher Algorithm for Securing Internet of Things
Proposed Lightweight Block Cipher Algorithm for Securing Internet of ThingsProposed Lightweight Block Cipher Algorithm for Securing Internet of Things
Proposed Lightweight Block Cipher Algorithm for Securing Internet of Things
 
Post Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical OverviewPost Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical Overview
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream Ciphers
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
One-Time Pad Encryption
One-Time Pad EncryptionOne-Time Pad Encryption
One-Time Pad Encryption
 
Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash Functions
 
Authenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmAuthenticated Encryption Gcm Ccm
Authenticated Encryption Gcm Ccm
 
Cryptography
CryptographyCryptography
Cryptography
 
Blockchaindev #1 - Ethereum Smart Contracts 101
Blockchaindev #1 - Ethereum Smart Contracts 101Blockchaindev #1 - Ethereum Smart Contracts 101
Blockchaindev #1 - Ethereum Smart Contracts 101
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed Hashing
 
ECDSA/EdDSA
ECDSA/EdDSAECDSA/EdDSA
ECDSA/EdDSA
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
CNIT 141 13. TLS
CNIT 141 13. TLSCNIT 141 13. TLS
CNIT 141 13. TLS
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
Cryptography Fundamentals
Cryptography FundamentalsCryptography Fundamentals
Cryptography Fundamentals
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)CISSP Prep: Ch 5. Communication and Network Security (Part 2)
CISSP Prep: Ch 5. Communication and Network Security (Part 2)
 

Similar to CNIT 141: 8. Authenticated Encryption

8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
ASRG SOS 2022 Encrypted messaging on CAN bus
ASRG SOS 2022 Encrypted messaging on CAN busASRG SOS 2022 Encrypted messaging on CAN bus
ASRG SOS 2022 Encrypted messaging on CAN busKenTindell
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers Sam Bowne
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
Basic Cryptography.pdf
Basic Cryptography.pdfBasic Cryptography.pdf
Basic Cryptography.pdfSetiya Nugroho
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. EncryptionSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
501 ch 10 cryptography
501 ch 10 cryptography501 ch 10 cryptography
501 ch 10 cryptographyToyeeb Onimole
 
CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)Sam Bowne
 
CNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed HashingCNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed HashingSam Bowne
 
SunshinePHP 2017: Tales From The Crypt - A Cryptography Primer
SunshinePHP 2017: Tales From The Crypt - A Cryptography PrimerSunshinePHP 2017: Tales From The Crypt - A Cryptography Primer
SunshinePHP 2017: Tales From The Crypt - A Cryptography PrimerAdam Englander
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 

Similar to CNIT 141: 8. Authenticated Encryption (20)

8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
ASRG SOS 2022 Encrypted messaging on CAN bus
ASRG SOS 2022 Encrypted messaging on CAN busASRG SOS 2022 Encrypted messaging on CAN bus
ASRG SOS 2022 Encrypted messaging on CAN bus
 
Slidecast - Workshop
Slidecast - WorkshopSlidecast - Workshop
Slidecast - Workshop
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
Basic Cryptography.pdf
Basic Cryptography.pdfBasic Cryptography.pdf
Basic Cryptography.pdf
 
CNIT 141: 1. Encryption
CNIT 141: 1. EncryptionCNIT 141: 1. Encryption
CNIT 141: 1. Encryption
 
CISSP - Chapter 3 - Cryptography
CISSP - Chapter 3 - CryptographyCISSP - Chapter 3 - Cryptography
CISSP - Chapter 3 - Cryptography
 
Wireless LAN Security Fundamentals
Wireless LAN Security FundamentalsWireless LAN Security Fundamentals
Wireless LAN Security Fundamentals
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
501 ch 10 cryptography
501 ch 10 cryptography501 ch 10 cryptography
501 ch 10 cryptography
 
CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)CISSP Prep: Ch 4. Security Engineering (Part 2)
CISSP Prep: Ch 4. Security Engineering (Part 2)
 
CNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed HashingCNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed Hashing
 
SunshinePHP 2017: Tales From The Crypt - A Cryptography Primer
SunshinePHP 2017: Tales From The Crypt - A Cryptography PrimerSunshinePHP 2017: Tales From The Crypt - A Cryptography Primer
SunshinePHP 2017: Tales From The Crypt - A Cryptography Primer
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
Encryption algorithms
Encryption algorithmsEncryption algorithms
Encryption algorithms
 

More from Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 
6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)Sam Bowne
 
4 Getting Started & 5 Leads
4 Getting Started & 5 Leads4 Getting Started & 5 Leads
4 Getting Started & 5 LeadsSam Bowne
 
3. Cryptographic Security
3. Cryptographic Security3. Cryptographic Security
3. Cryptographic SecuritySam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 
6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)6 Analyzing Android Applications (Part 2)
6 Analyzing Android Applications (Part 2)
 
4 Getting Started & 5 Leads
4 Getting Started & 5 Leads4 Getting Started & 5 Leads
4 Getting Started & 5 Leads
 
3. Cryptographic Security
3. Cryptographic Security3. Cryptographic Security
3. Cryptographic Security
 

Recently uploaded

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 

Recently uploaded (20)

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 

CNIT 141: 8. Authenticated Encryption

  • 1. CNIT 141 Cryptography for Computer Networks 8. Authenticated Encryption
  • 2. MAC v. AE • Message Authentication Code (MAC) • Protects a message's authenticity • With a tag, like a signature • But doesn't provide confidentiality • Authenticated Encryption (AE) • Produces an authentication tag • And also encrypts the message • Combining a cipher and a MAC
  • 3. Topics • Authenticated Encryption using MACs • Authenticated Ciphers • AES-GCM: The Authenticated Cipher Standard • OCB: An Authenticated Cipher Faster than GCM • SIV: The Safest Authenticated Cipher? • Permutation-Based AEAD • How Things Can Go Wrong
  • 6. Encrypt-and-MAC • Least secure system • MAC might leak information about P • Because MACs are only required to be unforgeable, not random • Used by SSH
  • 7. SSH • Each encrypted packet C • Is followed by the tag T = MAC(K, N || P) N is a sequence number • Secure in practice because the MAC algorithms are strong and don't leak information • Like HMAC-SHA-256
  • 8. Mac-then-Encrypt • First compute the tag • T = MAC(K2, P) • Then create ciphertext • C = E(K1, P || T) • More secure than encrypt-and-MAC • Hides plaintext tag, so it can't leak information about the plaintext • Used by TLS until version 1.3
  • 9. Encrypt-then-MAC • Sends two values • Ciphertext C = E(K1, P) • Tag T = MAC(K2, C) • Strongest system • Used by IPSec
  • 11. What is an Authenticated Cipher? • Different from combining cipher and MAC • Like a normal cipher, but • Returns an authentication tag along with ciphertext • AE(K,P) = (C, T) • Decryption • AD(K, C, T) = P
  • 12. Security Requirements • Authentication should be as strong as a MAC • Impossible to forge a (C,T) pair • That the AD function will accept and decrypt • Confidentiality is stronger than a basic cipher • Decryption will fail unless the tag is valid • Prevents chosen-ciphertext attacks
  • 13. Authenticated Encyption with Associated Data (AEAD) • Associated data is authenticated by the tag • But not encrypted • Example: network header data • AEAD(K, P, A) = (C, A, T) • Tag depends on both P and A • Will be rejected if C or A is modified • You can leave A or P empty
  • 14. Authenticated Encyption with Associated Data (AEAD) • You can leave A or P empty • If A is empty, AEAD is AE • If P is empty, AEAD is MAC
  • 15. Avoiding Predictability with Nonces • Use AE(K, P, A, N) • N is nonce and must not be re-used with the same key
  • 16. What Makes a Good Authenticated Cipher?
  • 17. Security Criteria • Confidentiality must be as strong as the best cipher • Authenticity must be as strong as the best MAC • Fragility if nonce is repeated (misuse resistance)
  • 18. • Parallelizability -- can process multiple blocks simultaneously • CTR is parallelizable, CBC is not Performance Criteria
  • 19. • Internal structure • Two-layer, like AES-CGM, • First layer is encryption of plaintext • Second layer is authentication • One-layer may be simpler and faster Performance Criteria
  • 20. • Streamable (aka online) • Can process a message block by block • Discarding completed blocks • Reduces RAM requirements • Nonstreamable ciphers must store the entire message • Typically because they must make two passes over the data Performance Criteria
  • 21. • Other features of implementation • Some AC only allow A to precede P • Others place it after, or anywhere • Some systems, like AES-CBC, requre two algorithms, one for encryption and one for decryption • AES-CTR can use the same algorithm for both • Cost may matter on low-cost dedicated hardware Functional Criteria
  • 23. AES-GCM • AES algorithm • Galois Counter Mode (GCM) • A tweak of CTR mode • Uses a small, efficient algorithm to compute an authentication tag
  • 24. AES-GCM • The most widely used authenticated cipher • The only authenticated cipher that is a NIST standard • Part of NSA's Suite B • Used in IPSec, SSH, and TLS 1.2
  • 25. • Encrypt-then-MAC • K is 128 bits • N is 96 bits • Uses "polynomial multiplication" with hash key H
  • 26.
  • 27. GCM Security • Fragile when nonce is repeated • If nonce is used twice, attacker can get authentication key H • And forge tags • In 2016, 184 HTTPS servers were found with repeated nonces • Including 23 using all-zeroes
  • 28. GCM Efficiency • GCM encryption and decryption are both parallelizable • But the MAC is not • GCM is streamable • Because the layers can be pipelined • Processing blocks one by one
  • 29. OCB: An Authenticated Cipher Faster than GCM
  • 30. Offset Codebook • Developed in 2001 • Faster and simpler than GCM • Limited by license until 2013 • Blends encryption and authentication into one layer • With only one key
  • 31. OCB Internals • Each block of plaintext is encrypted with a block cipher • With a key and an Offset computed from the key and a nonce that increments for each block
  • 32. OCB Internals • Tag uses S = P1 ^ P2 ^ P3 • XORs S with an offset computed from the last block's offset
  • 33. OCB • Support associated data also • With offset values that are different than those used to encrypt P
  • 34. OCB Security • Less fragile than GCM against repeated nonces • Attackers will see identical blocks of ciphertext, like ECB • But won't be able to find the secret key
  • 35. OCB Efficiency • OCB and GCM are about equally fast • Both are parallelizable and streamable • On early Intel processors, AES-GCM used to be three times slower than AES-OCB • Because the GHASH calculation is slower than the XORs used by OCB • GCM uses the same function for encryption and decryption • OCB requires two functions
  • 37. Synthetic IV (SIV) • An authenticated cipher mode • Typically used with AES • Secure even if you use the same nonce twice • Unlike GCM and OCB • Attacker will only learn that the same plaintest was encrypted twice
  • 38. SIV Construction • Combine encryption function E • And a pseudorandom function PRG • Using two keys K1 and K2 • And a nonce N • Tag: T = PRF(K1, N||P) • Ciphertext: C = E(K2, T, P) • T acts as the nonce of E
  • 39. SIV Performance • SIV is not streamable • After computing T, it must keep the entire plaintext P in memory • To encrypt 100 GB of plaintext, you must store 100 GB
  • 41. Permutation • Not a block cipher like AES • Simply transforms input to output of the same size • Reversibly, without using a key • Fast, secure, and more resistant to nonce reuse than GCM and OCB
  • 42. Permutation-Based AEAD • Start with initial state H0 • XOR with key K and nonce N • Permute with P to get new internal state
  • 43. Permutation-Based AEAD • This produces a series of pseudorandom blocks • XOR them with plaintext blocks to form ciphertext blocks
  • 44. Permutation-Based AEAD • Ciphertext is same length as plaintext • Internal state is larger than block size • Bits from last internal state form the tag
  • 45. Permutation-Based AEAD Security • Security relies on secrecy of the internal state • Blocks must be padded carefully • Nonce re-use is only a small problem • Attacker can only tell that messages began with same value
  • 46. Permutation-Based AEAD Performance • A single layer of operations • Streamable • A single core algorithm for encryption and decryption • But not parallelizable like GCM or OCB • New calls to P must wait for previous call to complete
  • 47. How Things Can Go Wrong
  • 48. Attack Surface • Authenticated ciphers must provide both confidentiality and authenticity • Take two values: plaintext P and associated data A • Must remain secure for all values of P and A • Even when one is absent, all zeroes, or very large
  • 49. Attack Surface • Must remain secure against attackers who collect numerous message/tag pairs • And against accidental repetition of nonces
  • 50. AES-GCM and Weak Hash Keys • GHASH uses a hash key H over and over for each block • Certain values of H make the tag weak • Because they form a "short cycle" and repeat every few blocks
  • 51. Tag Forgery • If H has a cycle of five • An attacker could swap the first and sixth block of ciphertext • And get the same authentication tag • Constructing a new valid message without knowing the key
  • 52. Consqeuences of Tag Forgery • To become root, swap second and sixth block • Changes uid to 1
  • 53. AES-GCM and Weak Hash Keys • Not practical to exploit • Attacker needs to know H or K to find cycle length • But still a defect of AES-GCM
  • 54. AES-GCM and Small Tags • Normally returns 128-bit tags • Those are secure • But can produce shorter tags, like 32 or 48 bits • Those are much weaker than they appear, for long messages • 48-bit tags for messages 4 GB long • Have one chance in a million of a forgery succeeding