2. Author
- application security specialist for NN
- studied hash functions and their applications at MFF UK
- decided to have a look on crypto projects in OWASP
4. Guide to Cryptography
• First hit at OWASP page for: Cryptography OWASP
• Part of Development Guide project (lab)
• Short summary about cryptography
• 4 cryptographic functions:
• confidentiality
• Integrity
• non-repudiation
• authentication
5. Guide to Cryptography
• Symmetric crypto
• Key exchange and sharing is a trouble
• Random number generators (later on for session cookies)
• Asymmetric crypto (RSA and DH)
• Hash functions
• Advises on:
• Algorithm Selection and key length (recommended to search withing NIST, but there
are more institution providing these recommendations.)
• Key storage
• Insecure transmission of secrets
• Reversible Authentication Tokens
• Safe UUID generation
• (Coldfusion methods?)
7. Cryptographic Storage Cheat Sheet
• Rule - Only store sensitive data that you need
• Rule - Use strong approved Authenticated Encryption (if you can
afford it)
• Rule - Use strong approved cryptographic algorithms
• Rule - Use approved cryptographic modes
• Rule - Ensure that the cryptographic protection remains secure even if
access controls fail
• Rule - Ensure that any secret key is protected from unauthorized
access (subrules present)
• Rule - Follow applicable regulations on use of cryptography (PCI req.)
8. Password Storage Cheat Sheet
• Do not limit the character set and set long max lengths for credentials
• Use a cryptographically strong credential-specific salt
• Impose infeasible verification on attacker
• PBKDF2 when FIPS certification or enterprise support on many platforms is
required;
• scrypt where resisting any/all hardware accelerated attacks is necessary but
support isn’t.
• bcrypt where PBKDF2 or scrypt support is not available
• Design password storage assuming eventual compromise
9. Transport Layer Protection Cheat Sheet
Secure Server Design
• Rule - Use TLS for All Login Pages and All Authenticated Pages
• Rule - Use TLS on Any Networks (External and Internal) Transmitting
Sensitive Data
• Rule - Do Not Provide Non-TLS Pages for Secure Content
• Rule - Do Not Mix TLS and Non-TLS Content
• Rule - Use "Secure" Cookie Flag
• Rule - Keep Sensitive Data Out of the URL
• Rule - Prevent Caching of Sensitive Data
• Rule - Use HTTP Strict Transport Security
• Rule - Use Public Key Pinning
10. Transport Layer Protection Cheat Sheet
Server Certificate
• Rule - Use Strong Keys & Protect Them
• Rule - Use a Certificate That Supports Required Domain
Names
• Rule - Use Fully Qualified Names in Certificates
• Rule - Do Not Use Wildcard Certificates
• Rule - Do Not Use Wildcard Certificates Rule
• Do Not Use RFC 1918 (Private) Addresses in Certificates
• Rule - Use an Appropriate Certification Authority for the
Application's User Base
• Rule - Always Provide All Needed Certificates
• Rule - Be aware of and have a plan for the SHA-1
deprecation plan
11. Transport Layer Protection Cheat Sheet
Server Protocol and Cipher Configuration
• Rule - Only Support Strong Protocols
• Rule - Prefer Ephemeral Key Exchanges
• Rule - Only Support Strong Cryptographic Ciphers
• Rule - Support TLS-PSK and TLS-SRP for Mutual Authentication
• Rule - Only Support Secure Renegotiations
• Rule - Disable Compression
• Test your overall TLS/SSL setup and your Certificate
• OWASP Testing Guide: Chapter on SSL/TLS Testing
• OWASP 'O-Saft' (OWASP SSL audit for testers / OWASP SSL advanced forensic tool)
• SSL LABS Server Test
12. OWASP Testing Guide: Testing for weak
cryptography
• Sensitive data transmitted in clear-text (Basic Authentication alike)
• Weak SSL/TLS Ciphers/Protocols/Keys
• nmap -sV --reason -PN -n --top-ports 100 www.example.com
• nmap --script ssl-cert,ssl-enum-ciphers –p 443,465,995 www.example.com
• Checking for Client-initiated Renegotiation and Secure Renegotiation via
openssl (manually: openssl s_client -connect example.com:443 -ssl3)
• SSL labs https://www.ssllabs.com/ssltest/
• Sslyze.py (last commit Oct 2014)
• Testssl.sh https://testssl.sh
• SSL Breacher
13. OWASP Testing Guide: Testing for Padding
Oracle (OTG-CRYPST-002)
Testing for Sensitive information sent via
unencrypted channels (OTG-CRYPST-003)
• Test any unencrypted channel (proxy, wireshark)
• Test for presence of form based authentication
over http
• Test for session cookies sent over http
14. Thank you for your attention
• You can contribute to any of the owasp projects
Notes de l'éditeur
Confidentiality – reading of the message is not possible for not intended readers
Integrity – it is possible to check if the message was not changed
Non-repudiation – it is not possible to deny reading the message (or not performing an acction)
Authentication – it is possible to prove your real/genuine identity
Stories about the first ciphers.
Computers started to help solving the mathematical problems and interestingly some of the problems still remains too difficult. Especially a number of An example can be calculating the squere roots… (in natural numbers and it becomes even more fun with Zn modular rings).
Asymetry – it is east
These cheat sheets were created by various application security professionals who have expertise in specific topics. We hope that the OWASP Cheat Sheet Series provides you with excellent security guidance in an easy to read format.