For a run-of-the-mill programmer, where are some places that I can look for crypto best practices? Eg. For storing passwords, Coda Hale's https://codahale.com/how-to-safely-store-a-password/ looks like it is still relevant, but how do I know that?
I know that cperciva and tptacek are some go-to people on HN, but where can I point other non-HN readers?
[+] [-] jjperezaguinaga|9 years ago|reply
The course is free and takes 6 weeks long, and is very interesting if you had never dwelled too deep into security or crypto. There's also a new cryptography class that will be available in September of 2017 - https://www.coursera.org/learn/crypto2.
[+] [-] hueving|9 years ago|reply
[+] [-] qjighap|9 years ago|reply
I have been enrolled in the crypto2 class for several years now. I hope they finally offer the course, but I have low hopes.
[+] [-] mlaretallack|9 years ago|reply
https://gist.github.com/TheZ3ro/fb521a3cde0c91fcb350
[+] [-] baby|9 years ago|reply
It's definitely completely relevant today. Find out what you want to do and check that list.
A few things I would update:
* password handling -> Scrypt or Argon2
* Client-server application security -> TLS or Noise
* Hashing/HMAC algorithm -> Blake2/prefix-MAC or KangarooTwelve/KMAC
* Fingerprint -> TupleHash
* key derivation -> HKDF or SHAKE or BLAKE2X
And of course for each of these items, if a NaCL/libsodium solution already exist, just use it.
[+] [-] cvwright|9 years ago|reply
For pretty much any crypto task that a "run-of-the-mill programmer" is likely to run into, they've got you covered.
Secret key encryption: https://download.libsodium.org/doc/secret-key_cryptography/a...
Password hashing: https://download.libsodium.org/doc/password_hashing/
[+] [-] bsder|9 years ago|reply
The problem I have with most of the crypto libraries is that their attack surface is absolutely enormous.
Most people don't need SSL. Most people don't need a zillion choices.
Most people need a single choice that actually works and is resistant to programmer error.
[+] [-] garrettr_|9 years ago|reply
Matthew Green's blog, A Few Thoughts on Cryptographic Engineering [1], has a wealth of interesting posts that are often aimed at explaining cryptography to a "technical but non-cryptographer" audience, and tend to be motivated by recent events in security/cryptography news.
[0]: https://www.amazon.com/Cryptography-Engineering-Principles-P... [1]: https://blog.cryptographyengineering.com/
[+] [-] lucb1e|9 years ago|reply
https://security.stackexchange.com
[+] [-] Tepix|9 years ago|reply
Start at https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
[+] [-] tptacek|9 years ago|reply
[+] [-] spydum|9 years ago|reply
[+] [-] tptacek|9 years ago|reply
[+] [-] lothiraldan|9 years ago|reply
The code examples are in Python, but I plan to add pages in other languages.
[+] [-] mistat|9 years ago|reply
[+] [-] mataug|9 years ago|reply
I've also come to realize that one should take everything that SG says with a large table spoon of salt.
[+] [-] pryelluw|9 years ago|reply
[+] [-] tlrobinson|9 years ago|reply
[+] [-] yeukhon|9 years ago|reply
[+] [-] cshep|9 years ago|reply
The OWASP guidance is OK for a quick access to best practices, but insufficient for rigorous learning.
Cryptography takes time to digest the fundamentals and recognise how new concepts are both beneficial and, vitally, disadvantageous; sadly, there is no cheat sheet or quick fix.
Source: computer security PhD student.
[+] [-] unknown|9 years ago|reply
[deleted]
[+] [-] yeukhon|9 years ago|reply
* PyCon Crypto 101 - https://www.crypto101.io/ (and if you use Python, please use Cryptography library for encryption/decryption please, Python built-in provides sha and hmac already though, and please adopt your framework's security implementation whenever possible).
* Mozilla Web Security Guidelines - https://wiki.mozilla.org/Security/Guidelines/Web_Security
* Mozilla Secure Coding Guideline - https://wiki.mozilla.org/WebAppSec/Secure_Coding_Guidelines
* Mozilla Server Side TLS - https://wiki.mozilla.org/Security/Server_Side_TLS
* Mozilla Intro to Cryptography (slide: https://april.github.io/crypto-presentation video: https://www.youtube.com/watch?v=bg32spD2mB0)
* Mozilla Web wiki - https://developer.mozilla.org/en-US/docs/Web (understand CORS, Cookies, CSP, etc)
* Google's course on security - https://google-gruyere.appspot.com/ (original course page has been taken down by Google already)
Book recommendations:
* The Web Application Hacker's Handbook
* The Tangled Web: A Guide to Securing Modern Web Applications (written by the famous Michał Zalewski working at Google, and lately known for developing the American Fuzzy Loop AFL which has been used for uncovering many new CVE bugs).
* Hacking: The Next Generation
* Securing DevOps (to be released soon)
Publications:
* USENIX - https://www.usenix.org/ (tons of free high quality conference talks, I like USENIX over ACM)
* Real World Crypto
Getting real
* Go find bug bounty program out there, many well-written posts how one discovered bugs
* Follow a bunch of security engineers / security-minded folks on Twitter (e.g. @matthew_d_green would be a good start)
OWASP is a great reference, you read it as an index page. But like others have pointed out, the Wiki is often outdated, but concepts almost always remain the same. Use multiple resources before implementing a solution, and never just copy and paste solution posted by others on Stackoverflow. Sorry for so many Mozilla stuff definitely there's some bias from me but I trust folks running the sec team there.
[+] [-] zitterbewegung|9 years ago|reply
[+] [-] elithrar|9 years ago|reply
> The other Password Hashing Competition finalists (Catena, Lyra2, Makwa, and yescrypt)
These were promoted above PBKDF2; algorithms with few implementations. PBKDF2-HMAC-SHA-512 with sufficient iterations is typically robust, and has been scrutinized.
I personally prefer scrypt, but in lieu of a solid scrypt or bcrypt lib I wouldn't hesitate to lean on PBKDF2 over the others.
Argon2i was in the same boat but being in libsodium went a long way to reinforcing trust, although Argon2i and Argon2d should really have had distinct names.
[+] [-] jeremymcanally|9 years ago|reply
I should probably update it to use one of the more modern algos, but the availability of good bcrypt libraries makes it solid advice still.
[+] [-] wooshy|9 years ago|reply
[+] [-] alinajaf|9 years ago|reply
http://cryptopals.com
[+] [-] deckar01|9 years ago|reply
[+] [-] bsder|9 years ago|reply
I see a lot of "don't use" but I don't see any "do use" for that case.
[+] [-] jasdeepsingh|9 years ago|reply
Underlock is a small Ruby library that helps with Encrypting/Decrypting of files and other data.
[+] [-] tptacek|9 years ago|reply
[+] [-] SAEIDBARAN1368|9 years ago|reply
[deleted]
[+] [-] nommm-nommm|9 years ago|reply
https://www.owasp.org/
NIST (government)
https://www.nist.gov/publications/
[+] [-] MaxfordAndSons|9 years ago|reply
OWASP seems like a decent source for learning about security topics at a high level (particularly web app security).
[1]http://dualec.org/