SlideShare a Scribd company logo
Modern Cryptography 
for Java Developers 
James McGivern
About This Talk 
• Not a treaty in mathematical theory 
• Rapid fire - please save questions until the 
end 
• Looking under the hood 
• Look at two popular algorithms 
• Hot cryptographic research
Definitions 
• Cryptography 
• Plaintext 
• Cyphertext 
• Code 
• Cypher vs Cipher 
• Encryption / Decryption 
• Key
“Secure Hashes” 
• A hash function takes an arbitrary length input and 
returns a fixed sized bit string 
• Cryptographic hash function obey 3 properties: 
• Given a hash h it should be hard to find a message m 
s.t. h = hash(m) 
• Given an input m1 it should be hard to find an m2 s.t. 
m1 != m2 and hash(m1) = hash(m2) 
• Should be hash collision resistant 
• MD5, SHA-1, SHA-3, RIPEMD-xxx
1,000,000 BC 
~WWII
A Challenge 
Gur Nafjre gb Yvsr, Gur Havirefr, naq 
Rirelguvat vf sbegl 42.
A Challenge 
The Answer to Life, The Universe, and 
Everything is 42.
The Enigma Machine 
Simon Singh
All Hail Turing 
©National Portrait Gallery 
and the others at Bletchley Park
Kerckhoff’s Principle 
“A cryptosystem should be secure even if 
everything about the system, except the key, 
is public knowledge”
Symmetric Encryption
Background 
• The only kind of encryption until 1973 
• The same cryptographic key for both 
encryption of plaintext and decryption of 
ciphertext 
• This is a “shared secret”
Cyphers
Cyphers 
3-Way Anubis CIPHERUNICORN-A 
Cobra COCONUT98 Crab 
Cryptomeria CRYPTON DFC 
FEAL FROG ICE M6 MARS 
Mercy MESH Nimbus Threefish 
Treyfer UES Xenon Zodiac
Cyphers 
3-Way Anubis CIPHERUNICORN-A 
Camellia Cobra CAST-COCONUT98 128 IDEA 
Crab 
Cryptomeria CRYPTON DFC 
FEAL FROG ICE M6 MARS 
RC2 RC5 SEED 
Skipjack TEA XTEA 
Mercy MESH Nimbus Threefish 
Treyfer UES Xenon Zodiac
Cyphers 
Serpent AES 
3-Way Anubis CIPHERUNICORN-A 
Cobra COCONUT98 Crab 
Cryptomeria CRYPTON DFC 
FEAL FROG ICE M6 MARS 
Blowfish 
DES 3DES 
Camellia CAST-128 IDEA 
RC2 RC5 SEED 
Skipjack TEA XTEA 
Mercy MESH Nimbus Threefish 
Twofish 
Treyfer UES Xenon Zodiac
Cypher Types 
• Block Cyphers 
• Stream Cyphers
All Hail Claude Shannon 
• Godfather of: 
• Information Theory 
• Digital Computing & Digital Circuit 
Design 
• Cryptographic Confusion 
• Cryptographic Diffusion 
• "the enemy knows the system"
S-Boxes 
• A function which maps an m bit input to an 
n bit output 
• Fixed lookup table vs dynamic based on key 
• Example: 6x4 S-Box:
AES 
• Based on the Rijndael cypher 
• Block size: 128 bits 
• Key size: 
• 128 bit - 10 rounds 
• 192 bit - 12 rounds 
• 256 bit - 14 rounds 
• Block represented as a 4×4 column-major 
order matrix of bytes called the state
AES Recipe 
• BEGIN 
• Key Expansion 
• LOOP (round) 
• Key XOR 
• Substitute 
• Transpose 
• Mix 
• END 
• Key XOR 
• Substitute 
• Transpose 
• Key XOR
Key Expansion 
• Each round of processing uses a round key 
• Round keys are derived from the primary 
key 
• AES uses the Rijndael Key Schedule 
• Round Keys are the same size as the state
Key XOR 
• Bit-wise XOR the round key with the state
Substitute 
• Replace each byte in the state using an S-box 
• This process is reversible but non-linear 
• The S-box is a derangement
Transpose
Mix 
• Apply an invertible linear transform to each 
cell (4 bytes) 
• This does not change the cell size 
• Together with Transpose provides 
cryptographic diffusion
AES Recipe 
• BEGIN 
• Key Expansion 
• LOOP (round) 
• Key XOR 
• Substitute 
• Transpose 
• Mix 
• END 
• Key XOR 
• Substitute 
• Transpose 
• Key XOR
Weaknesses 
• Direct Attacks 
• “Biclique Cryptanalysis of the Full AES” 
Cracks AES-128 with computational complexity 2126.1 
• Side channel attacks 
• 2005 cache-timing attack (requires root access) 
• 2009 some hardware implementations found to be 
susceptible to differential fault analysis allowing key 
recovery with complexity 232 
• 2010 access-driven cache attack, “near realtime” key 
recovery (requires root access)
Asymmetric Encryption
Background 
• 1973 - James H. Ellis, Clifford Cocks, and 
Malcolm Williamson @GCHQ 
• 1974/78 - Merkle’s Puzzles 
• 1976 - Whitfield Diffie and Martin Hellman 
• 1977/78 - Ron Rivest, Adi Shamir and 
Leonard Adleman @MIT
RSA 
• Based on the Integer Factorisation Problem 
• Believed to be in NP and co-NP 
• => not NP-complete 
• Is a fundamental part of HTTPS/SSL
Key generation 
• Choose two prime number p and q 
• Compute n = pq 
• Compute F(n) = F(p)F(q) = (p - 1)/(q - 1) 
• Chose an integer e s.t. 
• 1 < e < F(n) 
• gcd(e, F(n)) = 1 
• Compute d = 1 / e(mod F(n)) 
• Public Key = (e, n) 
• Private Key = (e, d)
Encryption 
• Given a message M 
• Convert M to an integer m s.t. 0 < m < 1 
• If necessary use a padding scheme 
• Computer the cypher text c: 
c = me (mod n)
Decryption 
• Given a cyphertext c 
• Compute m = cd (mod n) 
• Remove padding if present 
• Convert m in to M
Issues 
• Picking the numbers is hard 
• If p or q are too small or too close to each 
other it greatly decreases the security 
• If p-1 or q-1 only has small prime factors n 
can be factored in polynomial time 
• Side-channel attacks 
• Timing 
• Differential fault analysis (power)
Java Cryptography
Cryptographic Libraries 
• JCA 
• java.security 
• javax.security deprcated 
• JCE Providers 
• Oracle JCE + policies 
• The Legion of the Bouncy Castle
Useful Utils 
• Jasypt 
• Keytool IUI 
• Spring Crypto Utils 
• JCE taglib
Practical Tips 
• KISS 
• Choose the appropriate algorithm for the 
situation 
• Cost / benefit analysis 
• Key size 
• Hybrid encryption systems 
• Good quality RNG seeds
<Future> Cryptography
Quantum Computers 
@The Pub Explanation
The Basics 
• Binary vectors |0> and |1> 
• Qubit |q> = x|0> + y|1> 
where x2 + y2 = 1 
• Qubits 
|q> = a|00> + b|01> + c|11> + d|10>
Quantum Operations 
• An operation on n qubits can be 
represented by an nxn matrix 
• Also represented by quantum circuits 
• Always Reversible...
Measuring 
• Given |q> = -0.2|0> + 0.8|1> 
• Then the result of measuring q is: 
• 0 with probability 0.2 
• 1 with probability 0.8 
|q> = -0.1|00> + 0.4|01> + 0.4|11> + 0.1|10> 
|q> = -0.2|0> + 0.8|1> 
• Irreversible
Entanglement 
• Only a quantum effect 
• An entangled quantum system allows a higher 
correlation of states than classically possible 
• Given a qubit system in equal superposition 
Measuring the first qubit allows us to determine 
the state of the second without measuring
Grover’s Algorithm 
• Lov Grover 1996 
• Given some function f and an value y find x 
such that f(x) = y 
• O(N1/2) time complexity 
• O(log N) space complexity
Shor’s Algorithm 
Don’t leave this blank!
Shor’s Algorithm 
• Peter Shor 1994 
• Calculates the factors of a given integer 
• O((log N)3) 
• Belongs to BQP
Good News 
• The largest integer factored: 143 
• Largest quantum computer: 84 qubits
Quantum 
Cryptography
Post-Quantum 
Cryptography
Lattice-Based Cryptography 
• A lattice L in Rn is a discrete subgroup of 
Rn which spans the real vector space Rn 
• Each lattice has a set of bases 
• A basis is a set of vectors such that any 
vector is the lattice is a linear combination 
of the basis vectors 
• Can be viewed as a regular tiling of a space 
by a primitive cell
Graphical Representation 
Basis = { 
[0.5, 0], 
[0, 1] 
}
Shortest Vector Problem 
Given a lattice L in Rn find the shortest non-zero 
vector in L
Closest Vector Problem 
Given a lattice L in Rn and a vector v not in 
L, find the closest vector in L to v
NP-Hard 
• Non-deterministic polynomial time hard 
• For all problems in NP, any NP-hard 
problem is at least as hard as the hardest 
problem in NP 
• SVP & CVP are thought to be NP-hard 
• If we find a polynomial time algorithm for 
any NP-hard problem then P = NP!
Other Approaches 
• Multivariate Cryptography 
• Secure Hash Signatures 
• Lamport signatures 
• Merkle scheme 
• McEliece and Niedenrreiter Algorithms 
based on EEC
Summary 
• Modern cryptography really started ~1937 
• Symmetric cyhpers 
• Asymmetric cyphers 
• Non-classical cryptography 
• Post-quantum cryptography
Thank You

More Related Content

What's hot

Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
Cysinfo Cyber Security Community
 
block ciphers
block ciphersblock ciphers
block ciphers
Asad Ali
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
Göktuğ Serez
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptography
Samy Shehata
 
Fully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptxFully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptx
ssuser1716c81
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithm
Computer_ at_home
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
Vipin Tejwani
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryption
Christoph Matthies
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key Exchange
SAURABHDHAGE6
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptx
Sou Jana
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
Haris Ahmed
 
Homomorphic encryption
Homomorphic encryptionHomomorphic encryption
Homomorphic encryption
Namit Sinha
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
Abhishek Gautam
 
Computer Security Lecture 7: RSA
Computer Security Lecture 7: RSAComputer Security Lecture 7: RSA
Computer Security Lecture 7: RSA
Mohamed Loey
 
Cryptography
CryptographyCryptography
Cryptography
subodh pawar
 
Elgamal &amp; schnorr digital signature scheme copy
Elgamal &amp; schnorr digital signature scheme   copyElgamal &amp; schnorr digital signature scheme   copy
Elgamal &amp; schnorr digital signature scheme copy
North Cap University (NCU) Formely ITM University
 
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
JAINAM KAPADIYA
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve CryptographyKelly Bresnahan
 
Partial Homomorphic Encryption
Partial Homomorphic EncryptionPartial Homomorphic Encryption
Partial Homomorphic Encryption
securityxploded
 

What's hot (20)

Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptography
 
Fully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptxFully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptx
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithm
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryption
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key Exchange
 
Diffiehellman
DiffiehellmanDiffiehellman
Diffiehellman
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptx
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
 
Homomorphic encryption
Homomorphic encryptionHomomorphic encryption
Homomorphic encryption
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Computer Security Lecture 7: RSA
Computer Security Lecture 7: RSAComputer Security Lecture 7: RSA
Computer Security Lecture 7: RSA
 
Cryptography
CryptographyCryptography
Cryptography
 
Elgamal &amp; schnorr digital signature scheme copy
Elgamal &amp; schnorr digital signature scheme   copyElgamal &amp; schnorr digital signature scheme   copy
Elgamal &amp; schnorr digital signature scheme copy
 
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
Partial Homomorphic Encryption
Partial Homomorphic EncryptionPartial Homomorphic Encryption
Partial Homomorphic Encryption
 

Viewers also liked

A study of cryptography for satellite applications
A study of cryptography for satellite applicationsA study of cryptography for satellite applications
A study of cryptography for satellite applications
Rajesh Ishida
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptography
Martins Okoi
 
CrypTool: Cryptography for the masses
CrypTool: Cryptography for the massesCrypTool: Cryptography for the masses
CrypTool: Cryptography for the masses
Gonzalo Álvarez Marañón
 
Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice Cryptography
Priyanka Aash
 
Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)
Anas Rock
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
Samdish Arora
 
ECC vs RSA: Battle of the Crypto-Ninjas
ECC vs RSA: Battle of the Crypto-NinjasECC vs RSA: Battle of the Crypto-Ninjas
ECC vs RSA: Battle of the Crypto-Ninjas
James McGivern
 
Apprenticeship artifact
Apprenticeship  artifactApprenticeship  artifact
Apprenticeship artifact
Shooter24
 
Data Encryption and Decryption using Hill Cipher
Data Encryption and Decryption using Hill CipherData Encryption and Decryption using Hill Cipher
Data Encryption and Decryption using Hill Cipher
Aashirwad Kashyap
 
Cryptography by Epul
Cryptography by EpulCryptography by Epul
Cryptography by EpulAgate Studio
 
Rsa algorithm key generation
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation
swarnapatil
 
What is Cryptography?
What is Cryptography?What is Cryptography?
What is Cryptography?
Pratik Poddar
 
Message digest & digital signature
Message digest & digital signatureMessage digest & digital signature
Message digest & digital signatureDinesh Kodam
 
Basic ISDN
Basic ISDNBasic ISDN
Basic ISDN
Chris McAndrew
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
Kathirvel Ayyaswamy
 

Viewers also liked (20)

A study of cryptography for satellite applications
A study of cryptography for satellite applicationsA study of cryptography for satellite applications
A study of cryptography for satellite applications
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptography
 
CrypTool: Cryptography for the masses
CrypTool: Cryptography for the massesCrypTool: Cryptography for the masses
CrypTool: Cryptography for the masses
 
Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice Cryptography
 
Ch31
Ch31Ch31
Ch31
 
Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)
 
Cryptography
Cryptography Cryptography
Cryptography
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
 
ECC vs RSA: Battle of the Crypto-Ninjas
ECC vs RSA: Battle of the Crypto-NinjasECC vs RSA: Battle of the Crypto-Ninjas
ECC vs RSA: Battle of the Crypto-Ninjas
 
Apprenticeship artifact
Apprenticeship  artifactApprenticeship  artifact
Apprenticeship artifact
 
Data Encryption and Decryption using Hill Cipher
Data Encryption and Decryption using Hill CipherData Encryption and Decryption using Hill Cipher
Data Encryption and Decryption using Hill Cipher
 
Cryptography by Epul
Cryptography by EpulCryptography by Epul
Cryptography by Epul
 
Rsa algorithm key generation
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation
 
Cryptography
Cryptography Cryptography
Cryptography
 
What is Cryptography?
What is Cryptography?What is Cryptography?
What is Cryptography?
 
Message digest & digital signature
Message digest & digital signatureMessage digest & digital signature
Message digest & digital signature
 
Forouzan isdn
Forouzan isdnForouzan isdn
Forouzan isdn
 
PSTN
PSTNPSTN
PSTN
 
Basic ISDN
Basic ISDNBasic ISDN
Basic ISDN
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 

Similar to Modern Cryptography

Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
PriyanshuGupta896141
 
Oxford 05-oct-2012
Oxford 05-oct-2012Oxford 05-oct-2012
Oxford 05-oct-2012
Ted Dunning
 
Fast Single-pass K-means Clusterting at Oxford
Fast Single-pass K-means Clusterting at Oxford Fast Single-pass K-means Clusterting at Oxford
Fast Single-pass K-means Clusterting at Oxford
MapR Technologies
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
Sam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
Sam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
Sam Bowne
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
Sam Bowne
 
Clustering - ACM 2013 02-25
Clustering - ACM 2013 02-25Clustering - ACM 2013 02-25
Clustering - ACM 2013 02-25
MapR Technologies
 
Emily Stamm - Post-Quantum Cryptography
Emily Stamm - Post-Quantum CryptographyEmily Stamm - Post-Quantum Cryptography
Emily Stamm - Post-Quantum Cryptography
CSNP
 
Quantum cryptography by Girisha Shankar, Sr. Manager, Cisco
Quantum cryptography by Girisha Shankar, Sr. Manager, CiscoQuantum cryptography by Girisha Shankar, Sr. Manager, Cisco
Quantum cryptography by Girisha Shankar, Sr. Manager, Cisco
Vishnu Pendyala
 
Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3
rayborg
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
babak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
babak danyal
 
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
Aritra Sarkar
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
Sam Bowne
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptx
RobertCarreonBula
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
Animesh Shaw
 

Similar to Modern Cryptography (20)

Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
Cryptography-101
Cryptography-101Cryptography-101
Cryptography-101
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Oxford 05-oct-2012
Oxford 05-oct-2012Oxford 05-oct-2012
Oxford 05-oct-2012
 
Fast Single-pass K-means Clusterting at Oxford
Fast Single-pass K-means Clusterting at Oxford Fast Single-pass K-means Clusterting at Oxford
Fast Single-pass K-means Clusterting at Oxford
 
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
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 
Clustering - ACM 2013 02-25
Clustering - ACM 2013 02-25Clustering - ACM 2013 02-25
Clustering - ACM 2013 02-25
 
Emily Stamm - Post-Quantum Cryptography
Emily Stamm - Post-Quantum CryptographyEmily Stamm - Post-Quantum Cryptography
Emily Stamm - Post-Quantum Cryptography
 
Quantum cryptography by Girisha Shankar, Sr. Manager, Cisco
Quantum cryptography by Girisha Shankar, Sr. Manager, CiscoQuantum cryptography by Girisha Shankar, Sr. Manager, Cisco
Quantum cryptography by Girisha Shankar, Sr. Manager, Cisco
 
Class3
Class3Class3
Class3
 
Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
HiPEAC'19 Tutorial on Quantum algorithms using QX - 2019-01-23
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptx
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 

Recently uploaded

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 

Recently uploaded (20)

PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 

Modern Cryptography

  • 1. Modern Cryptography for Java Developers James McGivern
  • 2. About This Talk • Not a treaty in mathematical theory • Rapid fire - please save questions until the end • Looking under the hood • Look at two popular algorithms • Hot cryptographic research
  • 3. Definitions • Cryptography • Plaintext • Cyphertext • Code • Cypher vs Cipher • Encryption / Decryption • Key
  • 4. “Secure Hashes” • A hash function takes an arbitrary length input and returns a fixed sized bit string • Cryptographic hash function obey 3 properties: • Given a hash h it should be hard to find a message m s.t. h = hash(m) • Given an input m1 it should be hard to find an m2 s.t. m1 != m2 and hash(m1) = hash(m2) • Should be hash collision resistant • MD5, SHA-1, SHA-3, RIPEMD-xxx
  • 6. A Challenge Gur Nafjre gb Yvsr, Gur Havirefr, naq Rirelguvat vf sbegl 42.
  • 7. A Challenge The Answer to Life, The Universe, and Everything is 42.
  • 8. The Enigma Machine Simon Singh
  • 9. All Hail Turing ©National Portrait Gallery and the others at Bletchley Park
  • 10. Kerckhoff’s Principle “A cryptosystem should be secure even if everything about the system, except the key, is public knowledge”
  • 12. Background • The only kind of encryption until 1973 • The same cryptographic key for both encryption of plaintext and decryption of ciphertext • This is a “shared secret”
  • 14. Cyphers 3-Way Anubis CIPHERUNICORN-A Cobra COCONUT98 Crab Cryptomeria CRYPTON DFC FEAL FROG ICE M6 MARS Mercy MESH Nimbus Threefish Treyfer UES Xenon Zodiac
  • 15. Cyphers 3-Way Anubis CIPHERUNICORN-A Camellia Cobra CAST-COCONUT98 128 IDEA Crab Cryptomeria CRYPTON DFC FEAL FROG ICE M6 MARS RC2 RC5 SEED Skipjack TEA XTEA Mercy MESH Nimbus Threefish Treyfer UES Xenon Zodiac
  • 16. Cyphers Serpent AES 3-Way Anubis CIPHERUNICORN-A Cobra COCONUT98 Crab Cryptomeria CRYPTON DFC FEAL FROG ICE M6 MARS Blowfish DES 3DES Camellia CAST-128 IDEA RC2 RC5 SEED Skipjack TEA XTEA Mercy MESH Nimbus Threefish Twofish Treyfer UES Xenon Zodiac
  • 17. Cypher Types • Block Cyphers • Stream Cyphers
  • 18. All Hail Claude Shannon • Godfather of: • Information Theory • Digital Computing & Digital Circuit Design • Cryptographic Confusion • Cryptographic Diffusion • "the enemy knows the system"
  • 19. S-Boxes • A function which maps an m bit input to an n bit output • Fixed lookup table vs dynamic based on key • Example: 6x4 S-Box:
  • 20. AES • Based on the Rijndael cypher • Block size: 128 bits • Key size: • 128 bit - 10 rounds • 192 bit - 12 rounds • 256 bit - 14 rounds • Block represented as a 4×4 column-major order matrix of bytes called the state
  • 21. AES Recipe • BEGIN • Key Expansion • LOOP (round) • Key XOR • Substitute • Transpose • Mix • END • Key XOR • Substitute • Transpose • Key XOR
  • 22. Key Expansion • Each round of processing uses a round key • Round keys are derived from the primary key • AES uses the Rijndael Key Schedule • Round Keys are the same size as the state
  • 23. Key XOR • Bit-wise XOR the round key with the state
  • 24. Substitute • Replace each byte in the state using an S-box • This process is reversible but non-linear • The S-box is a derangement
  • 26. Mix • Apply an invertible linear transform to each cell (4 bytes) • This does not change the cell size • Together with Transpose provides cryptographic diffusion
  • 27. AES Recipe • BEGIN • Key Expansion • LOOP (round) • Key XOR • Substitute • Transpose • Mix • END • Key XOR • Substitute • Transpose • Key XOR
  • 28. Weaknesses • Direct Attacks • “Biclique Cryptanalysis of the Full AES” Cracks AES-128 with computational complexity 2126.1 • Side channel attacks • 2005 cache-timing attack (requires root access) • 2009 some hardware implementations found to be susceptible to differential fault analysis allowing key recovery with complexity 232 • 2010 access-driven cache attack, “near realtime” key recovery (requires root access)
  • 30. Background • 1973 - James H. Ellis, Clifford Cocks, and Malcolm Williamson @GCHQ • 1974/78 - Merkle’s Puzzles • 1976 - Whitfield Diffie and Martin Hellman • 1977/78 - Ron Rivest, Adi Shamir and Leonard Adleman @MIT
  • 31. RSA • Based on the Integer Factorisation Problem • Believed to be in NP and co-NP • => not NP-complete • Is a fundamental part of HTTPS/SSL
  • 32. Key generation • Choose two prime number p and q • Compute n = pq • Compute F(n) = F(p)F(q) = (p - 1)/(q - 1) • Chose an integer e s.t. • 1 < e < F(n) • gcd(e, F(n)) = 1 • Compute d = 1 / e(mod F(n)) • Public Key = (e, n) • Private Key = (e, d)
  • 33. Encryption • Given a message M • Convert M to an integer m s.t. 0 < m < 1 • If necessary use a padding scheme • Computer the cypher text c: c = me (mod n)
  • 34. Decryption • Given a cyphertext c • Compute m = cd (mod n) • Remove padding if present • Convert m in to M
  • 35. Issues • Picking the numbers is hard • If p or q are too small or too close to each other it greatly decreases the security • If p-1 or q-1 only has small prime factors n can be factored in polynomial time • Side-channel attacks • Timing • Differential fault analysis (power)
  • 37. Cryptographic Libraries • JCA • java.security • javax.security deprcated • JCE Providers • Oracle JCE + policies • The Legion of the Bouncy Castle
  • 38. Useful Utils • Jasypt • Keytool IUI • Spring Crypto Utils • JCE taglib
  • 39. Practical Tips • KISS • Choose the appropriate algorithm for the situation • Cost / benefit analysis • Key size • Hybrid encryption systems • Good quality RNG seeds
  • 41. Quantum Computers @The Pub Explanation
  • 42. The Basics • Binary vectors |0> and |1> • Qubit |q> = x|0> + y|1> where x2 + y2 = 1 • Qubits |q> = a|00> + b|01> + c|11> + d|10>
  • 43. Quantum Operations • An operation on n qubits can be represented by an nxn matrix • Also represented by quantum circuits • Always Reversible...
  • 44. Measuring • Given |q> = -0.2|0> + 0.8|1> • Then the result of measuring q is: • 0 with probability 0.2 • 1 with probability 0.8 |q> = -0.1|00> + 0.4|01> + 0.4|11> + 0.1|10> |q> = -0.2|0> + 0.8|1> • Irreversible
  • 45. Entanglement • Only a quantum effect • An entangled quantum system allows a higher correlation of states than classically possible • Given a qubit system in equal superposition Measuring the first qubit allows us to determine the state of the second without measuring
  • 46. Grover’s Algorithm • Lov Grover 1996 • Given some function f and an value y find x such that f(x) = y • O(N1/2) time complexity • O(log N) space complexity
  • 47. Shor’s Algorithm Don’t leave this blank!
  • 48. Shor’s Algorithm • Peter Shor 1994 • Calculates the factors of a given integer • O((log N)3) • Belongs to BQP
  • 49. Good News • The largest integer factored: 143 • Largest quantum computer: 84 qubits
  • 52. Lattice-Based Cryptography • A lattice L in Rn is a discrete subgroup of Rn which spans the real vector space Rn • Each lattice has a set of bases • A basis is a set of vectors such that any vector is the lattice is a linear combination of the basis vectors • Can be viewed as a regular tiling of a space by a primitive cell
  • 53. Graphical Representation Basis = { [0.5, 0], [0, 1] }
  • 54. Shortest Vector Problem Given a lattice L in Rn find the shortest non-zero vector in L
  • 55. Closest Vector Problem Given a lattice L in Rn and a vector v not in L, find the closest vector in L to v
  • 56. NP-Hard • Non-deterministic polynomial time hard • For all problems in NP, any NP-hard problem is at least as hard as the hardest problem in NP • SVP & CVP are thought to be NP-hard • If we find a polynomial time algorithm for any NP-hard problem then P = NP!
  • 57. Other Approaches • Multivariate Cryptography • Secure Hash Signatures • Lamport signatures • Merkle scheme • McEliece and Niedenrreiter Algorithms based on EEC
  • 58. Summary • Modern cryptography really started ~1937 • Symmetric cyhpers • Asymmetric cyphers • Non-classical cryptography • Post-quantum cryptography