SlideShare une entreprise Scribd logo
1  sur  59
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

Contenu connexe

Tendances

Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key CryptosystemDevakumar Kp
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Computer Security Lecture 7: RSA
Computer Security Lecture 7: RSAComputer Security Lecture 7: RSA
Computer Security Lecture 7: RSAMohamed Loey
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniquesvinitha96
 
Chapter 3-block-cipher-des1
Chapter 3-block-cipher-des1Chapter 3-block-cipher-des1
Chapter 3-block-cipher-des1Shiraz316
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authenticationchauhankapil
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation harshit chavda
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesJanani S
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSADr.Florence Dayana
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash functionChirag Patel
 
History of cryptography
History of cryptographyHistory of cryptography
History of cryptographyFarah Shaikh
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMACKrishna Gehlot
 
Message authentication
Message authenticationMessage authentication
Message authenticationCAS
 

Tendances (20)

Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 
Cryptography
CryptographyCryptography
Cryptography
 
Hash Function
Hash FunctionHash Function
Hash Function
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Cryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie BrownCryptography and Network Security William Stallings Lawrie Brown
Cryptography and Network Security William Stallings Lawrie Brown
 
Computer Security Lecture 7: RSA
Computer Security Lecture 7: RSAComputer Security Lecture 7: RSA
Computer Security Lecture 7: RSA
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniques
 
Chapter 3-block-cipher-des1
Chapter 3-block-cipher-des1Chapter 3-block-cipher-des1
Chapter 3-block-cipher-des1
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
History of cryptography
History of cryptographyHistory of cryptography
History of cryptography
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
Message authentication
Message authenticationMessage authentication
Message authentication
 

En vedette

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 applicationsRajesh Ishida
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptographyMartins Okoi
 
Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice CryptographyPriyanka 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 cryptosystemSamdish 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-NinjasJames McGivern
 
Apprenticeship artifact
Apprenticeship  artifactApprenticeship  artifact
Apprenticeship artifactShooter24
 
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 CipherAashirwad 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
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 

En vedette (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
 

Similaire à Modern Cryptography

Oxford 05-oct-2012
Oxford 05-oct-2012Oxford 05-oct-2012
Oxford 05-oct-2012Ted 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 CiphersSam 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
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers Sam Bowne
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic EncryptionGöktuğ Serez
 
Emily Stamm - Post-Quantum Cryptography
Emily Stamm - Post-Quantum CryptographyEmily Stamm - Post-Quantum Cryptography
Emily Stamm - Post-Quantum CryptographyCSNP
 
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, CiscoVishnu Pendyala
 
Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3rayborg
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak 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-23Aritra Sarkar
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam 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.pptxRobertCarreonBula
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & SteganographyAnimesh Shaw
 

Similaire à 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
 
Homomorphic Encryption
Homomorphic EncryptionHomomorphic Encryption
Homomorphic Encryption
 
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
 
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
 

Dernier

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

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