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

Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographySeema Goel
 
Post Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical OverviewPost Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical OverviewRamesh Nagappan
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2Mohamed Loey
 
block ciphers
block ciphersblock ciphers
block ciphersAsad Ali
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptographyMartins Okoi
 
History of cryptography
History of cryptographyHistory of cryptography
History of cryptographyFarah Shaikh
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptographySamy Shehata
 
Introduction to cryptography and types of ciphers
Introduction to cryptography and types of ciphersIntroduction to cryptography and types of ciphers
Introduction to cryptography and types of ciphersAswathi Nair
 
Cryptography
CryptographyCryptography
Cryptographyprasham95
 

Tendances (20)

Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
Post Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical OverviewPost Quantum Cryptography: Technical Overview
Post Quantum Cryptography: Technical Overview
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Cryptography Intro
Cryptography IntroCryptography Intro
Cryptography Intro
 
Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2Computer Security Lecture 3: Classical Encryption Techniques 2
Computer Security Lecture 3: Classical Encryption Techniques 2
 
Cryptography
CryptographyCryptography
Cryptography
 
Quantum cryptography
Quantum cryptographyQuantum cryptography
Quantum cryptography
 
Ch02...1
Ch02...1Ch02...1
Ch02...1
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Cryptography
CryptographyCryptography
Cryptography
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptography
 
History of cryptography
History of cryptographyHistory of cryptography
History of cryptography
 
Post quantum cryptography
Post quantum cryptographyPost quantum cryptography
Post quantum cryptography
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
DES
DESDES
DES
 
Introduction to cryptography and types of ciphers
Introduction to cryptography and types of ciphersIntroduction to cryptography and types of ciphers
Introduction to cryptography and types of ciphers
 
Cryptography
CryptographyCryptography
Cryptography
 
Rc4
Rc4Rc4
Rc4
 

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
 
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
 
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
 
ISDN & DSL
ISDN & DSLISDN & DSL
ISDN & DSL
 

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
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak 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.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
 
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
 

Dernier

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Dernier (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

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