SlideShare a Scribd company logo
Encryption
Deep Dive
Diego Pacheco
@diego_pacheco
❏ Cat's Father
❏ Head of Software Architect
❏ Agile Coach
❏ SOA/Microservices Expert
❏ DevOps Practitioner
❏ Speaker
❏ Author
diegopacheco
http://diego-pacheco.blogspot.com.br/
About me...
https://diegopacheco.github.io/
https://www.youtube.com/watch?v=WnkCdQb7S9s
Security 101
Asymmetrical Encryption
❏ Protect Data at Transit
❏ Public Key Cryptography
❏ Public Key does Encryption
❏ Private Key does Decryption
❏ Used on TLS/mTLS(HTTPS), SSH
❏ Algos: RSA, Diffie-Hellman, ECC
❏ Key Size often from 1 to 4kb
Symmetrical Encryption
❏ Protect Data at Rest (Payment, PII, etc…)
❏ Requires RNG and PRNG
❏ Biggest problem: Share / Access the
encryption keys
❏ Block vs Stream Algos
❏ Algos: AES, RC4, RC5
❏ Key Sizes: 128, 192, 256
❏ C = E(K,P ) - P = D(K,C)
Symmetrical Encryption
❏ Ciphertext same or slightly bigger than the plaintext
❏ Ciphertext is never smaller than the plaintext
❏ Permutations should be determined by the key
❏ Different keys should result in different permutation
❏ The permutation should look random
❏ Kerckhoffs Principle - 1883 - Really on a secret key - not on the
secrecy of the Cipher
❏ Storage vs Application level encryption
Application side encryption Drawbacks
❏ For sure more secure, however…
❏ Requires Engineering Discipline
❏ Requires constant Education / Training
❏ Cripple Features (Uniquines, Joins, Search)
❏ Bugs, Changes, Improvements Intrusive Require Migrations
❏ Key Scoping is mirror by Conway’s law / Architecture
Protecting Keys
❏ Storing the key on a hardware token(Smart Card or USB
dongle)
❏ On the fly generation from a password
❏ Wrapping - protecting the key with another key
❏ Key Management System
Randomness
❏ Randomness is a probability distribution
❏ Probability is about the likelihood of something happening:
0 never, 1 certain.
❏ Uniform Distribution when all probabilities are equal
chance do happens
❏ Toss a coin (Tail or Head) is 1/2 + 1/2 = 1, 1/2 chance head,
1/2 chance tail.
Entropy
❏ Entropy as a measure of Uncertain
❏ The measure of disorder in a system
❏ Entropy is the amount of surprise found in the result of
a random process
❏ Higher entropy less the certain found on the result
❏ Entropy is maximized when the distribution is uniform
RNG
❏ A Source of incertain, or a source of entropy
❏ A Crypto algo to produce high-quality bits from the source of
entropy
❏ RNG could be sampling from(Sources of entropy):
❏ measurements of temperature, acoustic noise, air turbulence,
or electric static (which are not always available)
❏ Entropy from OS: sensors, I/O devices, network, disk, logs,
running process (But can be fragile and manipulated by an
attacker)
PRNG
❏ Relly on RNG
❏ RNG product random bits(Analog) but slow and no deterministic
and no guarantee of high entropy
❏ PRNG: Random looking data, Quickly from Digital Sources,
deterministic and maximum entropy.
PRNG
❏ PRNG needs to ensure backtracking resistance (previously
generated bits are impossible to recover)
❏ PRNG needs to ensure prediction resistance (impossible to predict
future bits)
❏ /dev/random vs /dev/urandom (un-blocking)
❏ Java Secure Random
AES
❏ World defacto standard encryption
❏ NSA approved AES for TOP-Secret
information
❏ AES is more Belgian than American
❏ Blocks of 128 bits (128, 192, 256)
❏ AES will never be broken
❏ All input bytes depends on output bytes
in some complex pseudo random way
AES
❏ 2011 - People found a way to recover
AES 128 bits key but require an insane
amount of data plaintext ciphertext
pairs 2 ^ 88 bits (so we don't need to
worry about it)
❏ The biggest threat is not the CORE algo
bug the Operation Modes
❏ Authentication vs Confidentiality modes
AES Operational Modes
❏ Authenticated Encryption
❏ GCM
❏ CCM
❏ SIV
❏ AES-GCM-SIV
❏ Confidentiality only
❏ ECB
❏ CBC
❏ PCBC
❏ CFB, OFB and CTR
AES Operational Modes - ECB (Electronic Code Book)
AES Operational Modes - ECB (Electronic Code Book)
AES Operational Modes - CBC (Cipher Block Chaining)
AES Operational Modes - PCBC (Propagate Cipher Block Chaining)
Each Block XORed plaintext + ciphertext
AES Operational Modes - CFB (Cipher Feedback)
❏ Stream Cipher
❏ Decrypt
Parallel
❏ Encryption
Blocking
AES Operational Modes - OFB (Output Feedback)
❏ Stream Cipher
❏ Encrypt IV
❏ XOR plaintext
❏ Does not
require Padding
Data
AES Operational Modes - CTR
encryption/decryption parallelization
Java Secure Random
https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#SecureRandom
Java Secure Random
Java Generate Keys
Java Encrypt
Java Encrypt
Java Decrypt
Java Decrypt
Keys & Data Rotations
❏ Use cases: Regular or Breach
❏ Standard Industry Practice
❏ In AVG around 90 days
❏ Downtime vs No-Downtime
❏ Can have reliability implications
❏ Requires Data Catalogs
❏ Operationality, Observability, Rowbacability challenges
Envelope Encryption
❏ More Secure
❏ Industry Standard
❏ Keys with the Data
❏ Key Encrypting: Keys, Metadata and Data
❏ Bootstrapping problem
❏ KMS
AWS KMS
❏ Uses Cloud HSM to protect the Keys
❏ Keys lever leave AWS
❏ Remote Encryption always
❏ Symmetrical and Asymmetrical encryption
❏ Integrated with IAM and other services(EBS, S3, Kinesis,
RedShift, etc...)
❏ Cloud Trail
AWS KMS
Books
Encryption
Deep Dive
Diego Pacheco

More Related Content

What's hot (20)

PPT
Cryptography
PPT4U
 
PPT
Network security cryptography ppt
Thushara92
 
PPTX
Cryptography
Jens Patel
 
PPTX
Cryptography and Network Security
Pa Van Tanku
 
PPT
Data encryption, Description, DES
Huawei Technologies
 
DOCX
Data encryption standard
Prasad Prabhu
 
PPT
Old Linux Security Talk
Tanner Lovelace
 
PDF
Evolution of Network, Internet, Security and Public cryptography
jiricejka
 
PPTX
Cryptography and network security Nit701
Amit Pathak
 
PPTX
Cryptography
subodh pawar
 
PPTX
Cryptography and network security
Nagendra Um
 
PPT
Cryptography
Suhepi Saputri
 
PPT
Cryptography and network security
Mahipesh Satija
 
PPT
Fundamentals of cryptography
Hossain Md Shakhawat
 
PDF
Ch 12: Cryptography
Sam Bowne
 
PPTX
Ppt cns
Amit Pathak
 
PPTX
cryptography
Abhijeet Singh
 
PPTX
Cryptography
Pratiksha Patil
 
PPT
Cryptography
IGZ Software house
 
PPT
Cryptography cse,ru
Hossain Md Shakhawat
 
Cryptography
PPT4U
 
Network security cryptography ppt
Thushara92
 
Cryptography
Jens Patel
 
Cryptography and Network Security
Pa Van Tanku
 
Data encryption, Description, DES
Huawei Technologies
 
Data encryption standard
Prasad Prabhu
 
Old Linux Security Talk
Tanner Lovelace
 
Evolution of Network, Internet, Security and Public cryptography
jiricejka
 
Cryptography and network security Nit701
Amit Pathak
 
Cryptography
subodh pawar
 
Cryptography and network security
Nagendra Um
 
Cryptography
Suhepi Saputri
 
Cryptography and network security
Mahipesh Satija
 
Fundamentals of cryptography
Hossain Md Shakhawat
 
Ch 12: Cryptography
Sam Bowne
 
Ppt cns
Amit Pathak
 
cryptography
Abhijeet Singh
 
Cryptography
Pratiksha Patil
 
Cryptography
IGZ Software house
 
Cryptography cse,ru
Hossain Md Shakhawat
 

Similar to Encryption Deep Dive (20)

PPT
introduction to cryptography
Priyamvada Singh
 
PPT
needed.ppt
faizalkhan673954
 
PPT
crypto.ppt
Ganesh Chavan
 
PPT
crypto1.ppt
tommychauhan
 
PPT
introduction to cryptography (basics of it)
neonaveen
 
PPT
symet.crypto.hill.cipher.2023.ppt
halosidiq1
 
PDF
3 Basics of Cryptography Basics of Cryptography
MohammedMorhafJaely
 
PDF
CNIT 125 Ch 4. Security Engineering (Part 2)
Sam Bowne
 
PPT
CISSP EXAM PREPARATION FOR A PASSED SCORE
rinelaam
 
PDF
Cryptology - The practice and study of hiding information
Bitcoin Association of Australia
 
PDF
CISSP Prep: Ch 4. Security Engineering (Part 2)
Sam Bowne
 
PPT
Introduction to Block cipher Technology -unit 1
ramamoorthi24
 
KEY
Cryptography for developers
Kai Koenig
 
PPT
BCS_PKI_part1.ppt
UskuMusku1
 
PPTX
big data and Iot , its security part ,hoe yoy help this
warriorshanta
 
PPTX
501 ch 10 cryptography
Toyeeb Onimole
 
PDF
CNIT 141: 1. Encryption
Sam Bowne
 
PDF
4. Block Ciphers
Sam Bowne
 
PDF
Modern Cryptography
James McGivern
 
PDF
CNIT 123 12: Cryptography
Sam Bowne
 
introduction to cryptography
Priyamvada Singh
 
needed.ppt
faizalkhan673954
 
crypto.ppt
Ganesh Chavan
 
crypto1.ppt
tommychauhan
 
introduction to cryptography (basics of it)
neonaveen
 
symet.crypto.hill.cipher.2023.ppt
halosidiq1
 
3 Basics of Cryptography Basics of Cryptography
MohammedMorhafJaely
 
CNIT 125 Ch 4. Security Engineering (Part 2)
Sam Bowne
 
CISSP EXAM PREPARATION FOR A PASSED SCORE
rinelaam
 
Cryptology - The practice and study of hiding information
Bitcoin Association of Australia
 
CISSP Prep: Ch 4. Security Engineering (Part 2)
Sam Bowne
 
Introduction to Block cipher Technology -unit 1
ramamoorthi24
 
Cryptography for developers
Kai Koenig
 
BCS_PKI_part1.ppt
UskuMusku1
 
big data and Iot , its security part ,hoe yoy help this
warriorshanta
 
501 ch 10 cryptography
Toyeeb Onimole
 
CNIT 141: 1. Encryption
Sam Bowne
 
4. Block Ciphers
Sam Bowne
 
Modern Cryptography
James McGivern
 
CNIT 123 12: Cryptography
Sam Bowne
 
Ad

More from Diego Pacheco (20)

PDF
Naming Things Book : Simple Book Review!
Diego Pacheco
 
PDF
Continuous Discovery Habits Book Review.pdf
Diego Pacheco
 
PDF
Thoughts about Shape Up
Diego Pacheco
 
PDF
Holacracy
Diego Pacheco
 
PDF
AWS IAM
Diego Pacheco
 
PDF
CDKs
Diego Pacheco
 
PDF
Sec 101
Diego Pacheco
 
PDF
Reflections on SCM
Diego Pacheco
 
PDF
Management: Doing the non-obvious! III
Diego Pacheco
 
PDF
Design is not Subjective
Diego Pacheco
 
PDF
Architecture & Engineering : Doing the non-obvious!
Diego Pacheco
 
PDF
Management doing the non-obvious II
Diego Pacheco
 
PDF
Testing in production
Diego Pacheco
 
PDF
Nine lies about work
Diego Pacheco
 
PDF
Management: doing the nonobvious!
Diego Pacheco
 
PDF
AI and the Future
Diego Pacheco
 
PDF
Dealing with dependencies
Diego Pacheco
 
PDF
Dealing with dependencies in tests
Diego Pacheco
 
PDF
Kanban 2020
Diego Pacheco
 
PDF
Lean 2020
Diego Pacheco
 
Naming Things Book : Simple Book Review!
Diego Pacheco
 
Continuous Discovery Habits Book Review.pdf
Diego Pacheco
 
Thoughts about Shape Up
Diego Pacheco
 
Holacracy
Diego Pacheco
 
AWS IAM
Diego Pacheco
 
Sec 101
Diego Pacheco
 
Reflections on SCM
Diego Pacheco
 
Management: Doing the non-obvious! III
Diego Pacheco
 
Design is not Subjective
Diego Pacheco
 
Architecture & Engineering : Doing the non-obvious!
Diego Pacheco
 
Management doing the non-obvious II
Diego Pacheco
 
Testing in production
Diego Pacheco
 
Nine lies about work
Diego Pacheco
 
Management: doing the nonobvious!
Diego Pacheco
 
AI and the Future
Diego Pacheco
 
Dealing with dependencies
Diego Pacheco
 
Dealing with dependencies in tests
Diego Pacheco
 
Kanban 2020
Diego Pacheco
 
Lean 2020
Diego Pacheco
 
Ad

Recently uploaded (20)

PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
PDF
Upgrading to z_OS V2R4 Part 01 of 02.pdf
Flavio787771
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PDF
Sustainable and comertially viable mining process.pdf
Avijit Kumar Roy
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
PDF
Productivity Management Software | Workstatus
Lovely Baghel
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
Upgrading to z_OS V2R4 Part 01 of 02.pdf
Flavio787771
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
Sustainable and comertially viable mining process.pdf
Avijit Kumar Roy
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
Productivity Management Software | Workstatus
Lovely Baghel
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 

Encryption Deep Dive

  • 2. @diego_pacheco ❏ Cat's Father ❏ Head of Software Architect ❏ Agile Coach ❏ SOA/Microservices Expert ❏ DevOps Practitioner ❏ Speaker ❏ Author diegopacheco http://diego-pacheco.blogspot.com.br/ About me... https://diegopacheco.github.io/
  • 4. Asymmetrical Encryption ❏ Protect Data at Transit ❏ Public Key Cryptography ❏ Public Key does Encryption ❏ Private Key does Decryption ❏ Used on TLS/mTLS(HTTPS), SSH ❏ Algos: RSA, Diffie-Hellman, ECC ❏ Key Size often from 1 to 4kb
  • 5. Symmetrical Encryption ❏ Protect Data at Rest (Payment, PII, etc…) ❏ Requires RNG and PRNG ❏ Biggest problem: Share / Access the encryption keys ❏ Block vs Stream Algos ❏ Algos: AES, RC4, RC5 ❏ Key Sizes: 128, 192, 256 ❏ C = E(K,P ) - P = D(K,C)
  • 6. Symmetrical Encryption ❏ Ciphertext same or slightly bigger than the plaintext ❏ Ciphertext is never smaller than the plaintext ❏ Permutations should be determined by the key ❏ Different keys should result in different permutation ❏ The permutation should look random ❏ Kerckhoffs Principle - 1883 - Really on a secret key - not on the secrecy of the Cipher ❏ Storage vs Application level encryption
  • 7. Application side encryption Drawbacks ❏ For sure more secure, however… ❏ Requires Engineering Discipline ❏ Requires constant Education / Training ❏ Cripple Features (Uniquines, Joins, Search) ❏ Bugs, Changes, Improvements Intrusive Require Migrations ❏ Key Scoping is mirror by Conway’s law / Architecture
  • 8. Protecting Keys ❏ Storing the key on a hardware token(Smart Card or USB dongle) ❏ On the fly generation from a password ❏ Wrapping - protecting the key with another key ❏ Key Management System
  • 9. Randomness ❏ Randomness is a probability distribution ❏ Probability is about the likelihood of something happening: 0 never, 1 certain. ❏ Uniform Distribution when all probabilities are equal chance do happens ❏ Toss a coin (Tail or Head) is 1/2 + 1/2 = 1, 1/2 chance head, 1/2 chance tail.
  • 10. Entropy ❏ Entropy as a measure of Uncertain ❏ The measure of disorder in a system ❏ Entropy is the amount of surprise found in the result of a random process ❏ Higher entropy less the certain found on the result ❏ Entropy is maximized when the distribution is uniform
  • 11. RNG ❏ A Source of incertain, or a source of entropy ❏ A Crypto algo to produce high-quality bits from the source of entropy ❏ RNG could be sampling from(Sources of entropy): ❏ measurements of temperature, acoustic noise, air turbulence, or electric static (which are not always available) ❏ Entropy from OS: sensors, I/O devices, network, disk, logs, running process (But can be fragile and manipulated by an attacker)
  • 12. PRNG ❏ Relly on RNG ❏ RNG product random bits(Analog) but slow and no deterministic and no guarantee of high entropy ❏ PRNG: Random looking data, Quickly from Digital Sources, deterministic and maximum entropy.
  • 13. PRNG ❏ PRNG needs to ensure backtracking resistance (previously generated bits are impossible to recover) ❏ PRNG needs to ensure prediction resistance (impossible to predict future bits) ❏ /dev/random vs /dev/urandom (un-blocking) ❏ Java Secure Random
  • 14. AES ❏ World defacto standard encryption ❏ NSA approved AES for TOP-Secret information ❏ AES is more Belgian than American ❏ Blocks of 128 bits (128, 192, 256) ❏ AES will never be broken ❏ All input bytes depends on output bytes in some complex pseudo random way
  • 15. AES ❏ 2011 - People found a way to recover AES 128 bits key but require an insane amount of data plaintext ciphertext pairs 2 ^ 88 bits (so we don't need to worry about it) ❏ The biggest threat is not the CORE algo bug the Operation Modes ❏ Authentication vs Confidentiality modes
  • 16. AES Operational Modes ❏ Authenticated Encryption ❏ GCM ❏ CCM ❏ SIV ❏ AES-GCM-SIV ❏ Confidentiality only ❏ ECB ❏ CBC ❏ PCBC ❏ CFB, OFB and CTR
  • 17. AES Operational Modes - ECB (Electronic Code Book)
  • 18. AES Operational Modes - ECB (Electronic Code Book)
  • 19. AES Operational Modes - CBC (Cipher Block Chaining)
  • 20. AES Operational Modes - PCBC (Propagate Cipher Block Chaining) Each Block XORed plaintext + ciphertext
  • 21. AES Operational Modes - CFB (Cipher Feedback) ❏ Stream Cipher ❏ Decrypt Parallel ❏ Encryption Blocking
  • 22. AES Operational Modes - OFB (Output Feedback) ❏ Stream Cipher ❏ Encrypt IV ❏ XOR plaintext ❏ Does not require Padding Data
  • 23. AES Operational Modes - CTR encryption/decryption parallelization
  • 31. Keys & Data Rotations ❏ Use cases: Regular or Breach ❏ Standard Industry Practice ❏ In AVG around 90 days ❏ Downtime vs No-Downtime ❏ Can have reliability implications ❏ Requires Data Catalogs ❏ Operationality, Observability, Rowbacability challenges
  • 32. Envelope Encryption ❏ More Secure ❏ Industry Standard ❏ Keys with the Data ❏ Key Encrypting: Keys, Metadata and Data ❏ Bootstrapping problem ❏ KMS
  • 33. AWS KMS ❏ Uses Cloud HSM to protect the Keys ❏ Keys lever leave AWS ❏ Remote Encryption always ❏ Symmetrical and Asymmetrical encryption ❏ Integrated with IAM and other services(EBS, S3, Kinesis, RedShift, etc...) ❏ Cloud Trail
  • 35. Books