SlideShare a Scribd company logo
1 of 13
ENCRYPTION
Security Mechanism:
Authentication
Authorization
Session Management
Data Validation
Error Handling
Logging
Encryption
Encryption Core Concepts
Do NOT attempt to create your
own encryption algorithms.
Encryption Choices
Hash Encryption One Way or Reversible?
(e.g., SHA-256 vs. AES)
Stream Cipher Block Cipher Bits vs. Blocks
(e.g., RC4 vs. AES)
Symmetric Asymmetric Shared vs. Public & Private Keys
(e.g., AES vs. RSA)
Stream Cipher
ECB CBC CTR … Which Mode to Use?ECB CTR
Encryption Words to Live By
 If storing passwords – hash with a salt value
 If you’re using authentication – encrypt data in transit
 Properly seed random number generators
Encryption Words to Live By: #1
 The problem
– The software uses a one-way cryptographic hash against an input
that should not be reversible, such as a password, but the software
does not also use a salt as part of the input.
If storing passwords – hash with a salt value
Real World Example – Hash Compromise
Remember the Anonymous attack discussed earlier?
Secure Coding …
 Multiple rounds of hashing (>1000)
 Use the latest available hashing algorithms (SHA-2)
 How to create salt?
– Create small random value
– The salt should be different for each user
– Can use a hash of the userid in some use cases
 Where to store salt?
– In the database with the userid/password
– Often pre-pended to the password in storage
 Preferred method
– Pbkdf: https://en.wikipedia.org/wiki/PBKDF2
Encryption Words to Live By: #2
 The problem
– Login pages not using adequate measures to protect the user name
and password while they are in transit from the client to the server.
– SSL (Secure Socket Layer) provides data confidentiality and
integrity to HTTP. By encrypting HTTP messages, SSL protects
from attackers eavesdropping or altering message contents.
If you’re using authentication – encrypt in transmission
Real World Example – Packet Capture
Real World Example - POODLE
 CBC encryption in SSL 3.0
– SSL has been around
for 18 years
 Block cipher padding is
not deterministic
– not covered by the MAC
 Man in the Middle
– control request
– padding fills an entire block
– reveals one byte at a time
Encryption is HARD!
POODLE = Padding Oracle On Downgraded Legacy Encryption
Encryption Words to Live By: #3
 The problem
– The software may use insufficiently random numbers or values in a
security context that depends on unpredictable numbers.
– When software generates predictable values in a context requiring
unpredictability, it may be possible for an attacker to guess the next
value that will be generated, and use this guess to impersonate
another user or access sensitive information.
Properly seed random number generators
Use of Random Numbers
 Symmetric keys and initialization vectors for block ciphers
 Session IDs
 Gambling games
– lotteries
– slot machines
 Statistical sampling
 Seed for a Pseudo Random Number Generator
Real World Example - Chip and Pin
 Many ATMs and point-of-sale
terminals use a predictable
random number
 Attack:
– attacker predicts “unpredictable
number” (UN)
– customer uses a controlled terminal
– "extra" transaction is performed
using the UN and a future date
– chip on credit card produces an
Authorization Request Cryptogram
(ARQC) based on UN
– when time is right, attacker uses
fake card with pre-recorded ARQC
at ATM to withdraw cash
Secure Coding …
 Pitfalls
– Use of predictable random number generators
 C: rand()
 Java: java.util.Random()
– Forgetting to seed the random number generator -or- Using the
same seed every time
 will generate identical sequences of numbers
 Java.Security.SecureRandom
– (typically) uses the SHA1PRNG generator
– seeds itself using /dev/urandom
 collects random data from disk reads, mouse movement, keystrokes, etc.
– be careful overriding the PRNG or seed, make sure you know what
you are doing

More Related Content

Similar to 10 application security fundamentals - part 2 - security mechanisms - encryption

Crypto failures every developer should avoid
Crypto failures every developer should avoidCrypto failures every developer should avoid
Crypto failures every developer should avoidFilip Šebesta
 
6. cryptography
6. cryptography6. cryptography
6. cryptography7wounders
 
Computer Systems Security
Computer Systems SecurityComputer Systems Security
Computer Systems Securitydrkelleher
 
Computersystemssecurity 090529105555-phpapp01
Computersystemssecurity 090529105555-phpapp01Computersystemssecurity 090529105555-phpapp01
Computersystemssecurity 090529105555-phpapp01Miigaa Mine
 
Defending Against Attacks With Rails
Defending Against Attacks With RailsDefending Against Attacks With Rails
Defending Against Attacks With RailsTony Amoyal
 
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...POSSCON
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographySeema Goel
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Svetlin Nakov
 
Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)Nate Lawson
 
Secure 3 kany-vanda
Secure 3 kany-vandaSecure 3 kany-vanda
Secure 3 kany-vandaVanda KANY
 
TM112 Meeting12-Cryptography.pptx
TM112 Meeting12-Cryptography.pptxTM112 Meeting12-Cryptography.pptx
TM112 Meeting12-Cryptography.pptxMohammedYusuf609377
 
Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Abhishek Kumar
 
Introduction to encryption
Introduction to encryptionIntroduction to encryption
Introduction to encryptionfaffyman
 
Cryptography
CryptographyCryptography
CryptographyRohan04
 

Similar to 10 application security fundamentals - part 2 - security mechanisms - encryption (20)

Crypto failures every developer should avoid
Crypto failures every developer should avoidCrypto failures every developer should avoid
Crypto failures every developer should avoid
 
Cryptography
CryptographyCryptography
Cryptography
 
6. cryptography
6. cryptography6. cryptography
6. cryptography
 
Windows network security
Windows network securityWindows network security
Windows network security
 
Computer Systems Security
Computer Systems SecurityComputer Systems Security
Computer Systems Security
 
Computersystemssecurity 090529105555-phpapp01
Computersystemssecurity 090529105555-phpapp01Computersystemssecurity 090529105555-phpapp01
Computersystemssecurity 090529105555-phpapp01
 
Java Crypto
Java CryptoJava Crypto
Java Crypto
 
Windows network
Windows networkWindows network
Windows network
 
Defending Against Attacks With Rails
Defending Against Attacks With RailsDefending Against Attacks With Rails
Defending Against Attacks With Rails
 
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
 
Getting authentication right
Getting authentication rightGetting authentication right
Getting authentication right
 
Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)Crypto Strikes Back! (Google 2009)
Crypto Strikes Back! (Google 2009)
 
Secure 3 kany-vanda
Secure 3 kany-vandaSecure 3 kany-vanda
Secure 3 kany-vanda
 
TM112 Meeting12-Cryptography.pptx
TM112 Meeting12-Cryptography.pptxTM112 Meeting12-Cryptography.pptx
TM112 Meeting12-Cryptography.pptx
 
Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)Insecurity-In-Security version.1 (2010)
Insecurity-In-Security version.1 (2010)
 
Cryptography
CryptographyCryptography
Cryptography
 
Introduction to encryption
Introduction to encryptionIntroduction to encryption
Introduction to encryption
 
Cryptography
CryptographyCryptography
Cryptography
 

More from appsec

23 owasp top 10 - resources
23   owasp top 10 - resources23   owasp top 10 - resources
23 owasp top 10 - resourcesappsec
 
15 owasp top 10 - a3-xss
15   owasp top 10 - a3-xss15   owasp top 10 - a3-xss
15 owasp top 10 - a3-xssappsec
 
12 owasp top 10 - introduction
12   owasp top 10 - introduction12   owasp top 10 - introduction
12 owasp top 10 - introductionappsec
 
11 application security fundamentals - part 2 - security mechanisms - summary
11   application security fundamentals - part 2 - security mechanisms - summary11   application security fundamentals - part 2 - security mechanisms - summary
11 application security fundamentals - part 2 - security mechanisms - summaryappsec
 
09 application security fundamentals - part 2 - security mechanisms - logging
09   application security fundamentals - part 2 - security mechanisms - logging09   application security fundamentals - part 2 - security mechanisms - logging
09 application security fundamentals - part 2 - security mechanisms - loggingappsec
 
08 application security fundamentals - part 2 - security mechanisms - error...
08   application security fundamentals - part 2 - security mechanisms - error...08   application security fundamentals - part 2 - security mechanisms - error...
08 application security fundamentals - part 2 - security mechanisms - error...appsec
 
06 application security fundamentals - part 2 - security mechanisms - sessi...
06   application security fundamentals - part 2 - security mechanisms - sessi...06   application security fundamentals - part 2 - security mechanisms - sessi...
06 application security fundamentals - part 2 - security mechanisms - sessi...appsec
 
07 application security fundamentals - part 2 - security mechanisms - data ...
07   application security fundamentals - part 2 - security mechanisms - data ...07   application security fundamentals - part 2 - security mechanisms - data ...
07 application security fundamentals - part 2 - security mechanisms - data ...appsec
 
04 application security fundamentals - part 2 - security mechanisms - authe...
04   application security fundamentals - part 2 - security mechanisms - authe...04   application security fundamentals - part 2 - security mechanisms - authe...
04 application security fundamentals - part 2 - security mechanisms - authe...appsec
 
05 application security fundamentals - part 2 - security mechanisms - autho...
05   application security fundamentals - part 2 - security mechanisms - autho...05   application security fundamentals - part 2 - security mechanisms - autho...
05 application security fundamentals - part 2 - security mechanisms - autho...appsec
 
02 application security fundamentals - part 1 - security priciples
02   application security fundamentals - part 1 - security priciples02   application security fundamentals - part 1 - security priciples
02 application security fundamentals - part 1 - security priciplesappsec
 
01 Application Security Fundamentals - part 1 - introduction and goals
01 Application Security Fundamentals - part 1 - introduction and goals01 Application Security Fundamentals - part 1 - introduction and goals
01 Application Security Fundamentals - part 1 - introduction and goalsappsec
 

More from appsec (12)

23 owasp top 10 - resources
23   owasp top 10 - resources23   owasp top 10 - resources
23 owasp top 10 - resources
 
15 owasp top 10 - a3-xss
15   owasp top 10 - a3-xss15   owasp top 10 - a3-xss
15 owasp top 10 - a3-xss
 
12 owasp top 10 - introduction
12   owasp top 10 - introduction12   owasp top 10 - introduction
12 owasp top 10 - introduction
 
11 application security fundamentals - part 2 - security mechanisms - summary
11   application security fundamentals - part 2 - security mechanisms - summary11   application security fundamentals - part 2 - security mechanisms - summary
11 application security fundamentals - part 2 - security mechanisms - summary
 
09 application security fundamentals - part 2 - security mechanisms - logging
09   application security fundamentals - part 2 - security mechanisms - logging09   application security fundamentals - part 2 - security mechanisms - logging
09 application security fundamentals - part 2 - security mechanisms - logging
 
08 application security fundamentals - part 2 - security mechanisms - error...
08   application security fundamentals - part 2 - security mechanisms - error...08   application security fundamentals - part 2 - security mechanisms - error...
08 application security fundamentals - part 2 - security mechanisms - error...
 
06 application security fundamentals - part 2 - security mechanisms - sessi...
06   application security fundamentals - part 2 - security mechanisms - sessi...06   application security fundamentals - part 2 - security mechanisms - sessi...
06 application security fundamentals - part 2 - security mechanisms - sessi...
 
07 application security fundamentals - part 2 - security mechanisms - data ...
07   application security fundamentals - part 2 - security mechanisms - data ...07   application security fundamentals - part 2 - security mechanisms - data ...
07 application security fundamentals - part 2 - security mechanisms - data ...
 
04 application security fundamentals - part 2 - security mechanisms - authe...
04   application security fundamentals - part 2 - security mechanisms - authe...04   application security fundamentals - part 2 - security mechanisms - authe...
04 application security fundamentals - part 2 - security mechanisms - authe...
 
05 application security fundamentals - part 2 - security mechanisms - autho...
05   application security fundamentals - part 2 - security mechanisms - autho...05   application security fundamentals - part 2 - security mechanisms - autho...
05 application security fundamentals - part 2 - security mechanisms - autho...
 
02 application security fundamentals - part 1 - security priciples
02   application security fundamentals - part 1 - security priciples02   application security fundamentals - part 1 - security priciples
02 application security fundamentals - part 1 - security priciples
 
01 Application Security Fundamentals - part 1 - introduction and goals
01 Application Security Fundamentals - part 1 - introduction and goals01 Application Security Fundamentals - part 1 - introduction and goals
01 Application Security Fundamentals - part 1 - introduction and goals
 

Recently uploaded

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

10 application security fundamentals - part 2 - security mechanisms - encryption

  • 2. Encryption Core Concepts Do NOT attempt to create your own encryption algorithms. Encryption Choices Hash Encryption One Way or Reversible? (e.g., SHA-256 vs. AES) Stream Cipher Block Cipher Bits vs. Blocks (e.g., RC4 vs. AES) Symmetric Asymmetric Shared vs. Public & Private Keys (e.g., AES vs. RSA) Stream Cipher ECB CBC CTR … Which Mode to Use?ECB CTR
  • 3. Encryption Words to Live By  If storing passwords – hash with a salt value  If you’re using authentication – encrypt data in transit  Properly seed random number generators
  • 4. Encryption Words to Live By: #1  The problem – The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software does not also use a salt as part of the input. If storing passwords – hash with a salt value
  • 5. Real World Example – Hash Compromise Remember the Anonymous attack discussed earlier?
  • 6. Secure Coding …  Multiple rounds of hashing (>1000)  Use the latest available hashing algorithms (SHA-2)  How to create salt? – Create small random value – The salt should be different for each user – Can use a hash of the userid in some use cases  Where to store salt? – In the database with the userid/password – Often pre-pended to the password in storage  Preferred method – Pbkdf: https://en.wikipedia.org/wiki/PBKDF2
  • 7. Encryption Words to Live By: #2  The problem – Login pages not using adequate measures to protect the user name and password while they are in transit from the client to the server. – SSL (Secure Socket Layer) provides data confidentiality and integrity to HTTP. By encrypting HTTP messages, SSL protects from attackers eavesdropping or altering message contents. If you’re using authentication – encrypt in transmission
  • 8. Real World Example – Packet Capture
  • 9. Real World Example - POODLE  CBC encryption in SSL 3.0 – SSL has been around for 18 years  Block cipher padding is not deterministic – not covered by the MAC  Man in the Middle – control request – padding fills an entire block – reveals one byte at a time Encryption is HARD! POODLE = Padding Oracle On Downgraded Legacy Encryption
  • 10. Encryption Words to Live By: #3  The problem – The software may use insufficiently random numbers or values in a security context that depends on unpredictable numbers. – When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information. Properly seed random number generators
  • 11. Use of Random Numbers  Symmetric keys and initialization vectors for block ciphers  Session IDs  Gambling games – lotteries – slot machines  Statistical sampling  Seed for a Pseudo Random Number Generator
  • 12. Real World Example - Chip and Pin  Many ATMs and point-of-sale terminals use a predictable random number  Attack: – attacker predicts “unpredictable number” (UN) – customer uses a controlled terminal – "extra" transaction is performed using the UN and a future date – chip on credit card produces an Authorization Request Cryptogram (ARQC) based on UN – when time is right, attacker uses fake card with pre-recorded ARQC at ATM to withdraw cash
  • 13. Secure Coding …  Pitfalls – Use of predictable random number generators  C: rand()  Java: java.util.Random() – Forgetting to seed the random number generator -or- Using the same seed every time  will generate identical sequences of numbers  Java.Security.SecureRandom – (typically) uses the SHA1PRNG generator – seeds itself using /dev/urandom  collects random data from disk reads, mouse movement, keystrokes, etc. – be careful overriding the PRNG or seed, make sure you know what you are doing