TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Current Crypto Best Practices

198 点作者 msingle大约 8 年前
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?

17 条评论

jjperezaguinaga大约 8 年前
If you come from a computer science&#x2F;math background, and want an intro to cryptography in general, I can strongly recommend the Coursera course from Stanford University by professor Dan Boneh - <a href="https:&#x2F;&#x2F;www.coursera.org&#x2F;learn&#x2F;crypto" rel="nofollow">https:&#x2F;&#x2F;www.coursera.org&#x2F;learn&#x2F;crypto</a>. To really understand the implementations of security libraries and tools, one should be at least familiar with the fundamentals and terminology of crypto. Otherwise you are blindly encrypting things without being aware of whether you are actually securing things.<p>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&#x27;s also a new cryptography class that will be available in September of 2017 - <a href="https:&#x2F;&#x2F;www.coursera.org&#x2F;learn&#x2F;crypto2" rel="nofollow">https:&#x2F;&#x2F;www.coursera.org&#x2F;learn&#x2F;crypto2</a>.
评论 #14044008 未加载
评论 #14042427 未加载
mlaretallack大约 8 年前
Cryptographic Right Answers is a good place to start<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;TheZ3ro&#x2F;fb521a3cde0c91fcb350" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;TheZ3ro&#x2F;fb521a3cde0c91fcb350</a>
评论 #14042449 未加载
cvwright大约 8 年前
I&#x27;m surprised to see so few recommendations for libsodium. <a href="https:&#x2F;&#x2F;download.libsodium.org&#x2F;doc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;download.libsodium.org&#x2F;doc&#x2F;</a><p>For pretty much any crypto task that a &quot;run-of-the-mill programmer&quot; is likely to run into, they&#x27;ve got you covered.<p>Secret key encryption: <a href="https:&#x2F;&#x2F;download.libsodium.org&#x2F;doc&#x2F;secret-key_cryptography&#x2F;authenticated_encryption.html" rel="nofollow">https:&#x2F;&#x2F;download.libsodium.org&#x2F;doc&#x2F;secret-key_cryptography&#x2F;a...</a><p>Password hashing: <a href="https:&#x2F;&#x2F;download.libsodium.org&#x2F;doc&#x2F;password_hashing&#x2F;" rel="nofollow">https:&#x2F;&#x2F;download.libsodium.org&#x2F;doc&#x2F;password_hashing&#x2F;</a>
评论 #14045593 未加载
garrettr_大约 8 年前
Cryptography Engineering [0] is a great book that covers key topics in cryptography with a focus on best practices for implementors and system&#x2F;protocol designers.<p>Matthew Green&#x27;s blog, A Few Thoughts on Cryptographic Engineering [1], has a wealth of interesting posts that are often aimed at explaining cryptography to a &quot;technical but non-cryptographer&quot; audience, and tend to be motivated by recent events in security&#x2F;cryptography news.<p>[0]: <a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Cryptography-Engineering-Principles-Practical-Applications&#x2F;dp&#x2F;0470474246" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Cryptography-Engineering-Principles-P...</a> [1]: <a href="https:&#x2F;&#x2F;blog.cryptographyengineering.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.cryptographyengineering.com&#x2F;</a>
lucb1e大约 8 年前
The IT Security StackExchange website contains lots of information which is generally kept reasonably up to date. For example a TLS answer might be a bit old and not list last week&#x27;s attack, but if something turns incorrect it will often be edited.<p><a href="https:&#x2F;&#x2F;security.stackexchange.com" rel="nofollow">https:&#x2F;&#x2F;security.stackexchange.com</a>
Tepix大约 8 年前
OWASP has some nice guidelines on a lot of topics, including storing passwords.<p>Start at <a href="https:&#x2F;&#x2F;www.owasp.org&#x2F;index.php&#x2F;Password_Storage_Cheat_Sheet" rel="nofollow">https:&#x2F;&#x2F;www.owasp.org&#x2F;index.php&#x2F;Password_Storage_Cheat_Sheet</a>
评论 #14042864 未加载
评论 #14042192 未加载
tptacek大约 8 年前
The answers for this depend on what you&#x27;re trying to do. Can you be more specific? Coda&#x27;s password storage advice is still the best advice for people who don&#x27;t know what they&#x27;d do otherwise.
lothiraldan大约 8 年前
I&#x27;m currently building a community website for these kind of questions (storing password, constant-time token comparison), the design is pretty raw for the moment: <a href="https:&#x2F;&#x2F;sqreen.github.io&#x2F;DevelopersSecurityBestPractices&#x2F;safe-password-storage&#x2F;python" rel="nofollow">https:&#x2F;&#x2F;sqreen.github.io&#x2F;DevelopersSecurityBestPractices&#x2F;saf...</a><p>The code examples are in Python, but I plan to add pages in other languages.
mistat大约 8 年前
The golden rule about storing a password is to not store a password... I can&#x27;t wait till SQRL takes off
评论 #14042097 未加载
评论 #14042090 未加载
评论 #14042239 未加载
评论 #14042490 未加载
cshep大约 8 年前
Dan Boneh&#x27;s Coursera course is ideal for any beginner. Cryptography Engineering by Schneier et al. is good, as is Ross Anderson&#x27;s Security Engineering, but both are fairly dated.<p>The OWASP guidance is OK for a quick access to best practices, but insufficient for rigorous learning.<p>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.<p>Source: computer security PhD student.
yeukhon大约 8 年前
Quick sites:<p>* PyCon Crypto 101 - <a href="https:&#x2F;&#x2F;www.crypto101.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.crypto101.io&#x2F;</a> (and if you use Python, please use Cryptography library for encryption&#x2F;decryption please, Python built-in provides sha and hmac already though, and please adopt your framework&#x27;s security implementation whenever possible).<p>* Mozilla Web Security Guidelines - <a href="https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;Security&#x2F;Guidelines&#x2F;Web_Security" rel="nofollow">https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;Security&#x2F;Guidelines&#x2F;Web_Security</a><p>* Mozilla Secure Coding Guideline - <a href="https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;WebAppSec&#x2F;Secure_Coding_Guidelines" rel="nofollow">https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;WebAppSec&#x2F;Secure_Coding_Guidelines</a><p>* Mozilla Server Side TLS - <a href="https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;Security&#x2F;Server_Side_TLS" rel="nofollow">https:&#x2F;&#x2F;wiki.mozilla.org&#x2F;Security&#x2F;Server_Side_TLS</a><p>* Mozilla Intro to Cryptography (slide: <a href="https:&#x2F;&#x2F;april.github.io&#x2F;crypto-presentation" rel="nofollow">https:&#x2F;&#x2F;april.github.io&#x2F;crypto-presentation</a> video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=bg32spD2mB0" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=bg32spD2mB0</a>)<p>* Mozilla Web wiki - <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web</a> (understand CORS, Cookies, CSP, etc)<p>* Google&#x27;s course on security - <a href="https:&#x2F;&#x2F;google-gruyere.appspot.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;google-gruyere.appspot.com&#x2F;</a> (original course page has been taken down by Google already)<p>Book recommendations:<p>* The Web Application Hacker&#x27;s Handbook<p>* 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).<p>* Hacking: The Next Generation<p>* Securing DevOps (to be released soon)<p>Publications:<p>* USENIX - <a href="https:&#x2F;&#x2F;www.usenix.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.usenix.org&#x2F;</a> (tons of free high quality conference talks, I like USENIX over ACM)<p>* Real World Crypto<p>Getting real<p>* Go find bug bounty program out there, many well-written posts how one discovered bugs<p>* Follow a bunch of security engineers &#x2F; security-minded folks on Twitter (e.g. @matthew_d_green would be a good start)<p>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&#x27;s some bias from me but I trust folks running the sec team there.
zitterbewegung大约 8 年前
A good guide for password hashing is <a href="https:&#x2F;&#x2F;paragonie.com&#x2F;blog&#x2F;2016&#x2F;02&#x2F;how-safely-store-password-in-2016" rel="nofollow">https:&#x2F;&#x2F;paragonie.com&#x2F;blog&#x2F;2016&#x2F;02&#x2F;how-safely-store-password...</a> . I think your codehale link is out of date since it&#x27;s from 2010.
评论 #14042250 未加载
jeremymcanally大约 8 年前
I made this a while ago: <a href="http:&#x2F;&#x2F;howtostoreapassword.com" rel="nofollow">http:&#x2F;&#x2F;howtostoreapassword.com</a>. Still relevant I think. :)<p>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.
评论 #14045649 未加载
alinajaf大约 8 年前
Not necessarily best practices, but I recommend the Matasano Crypto Challenges to basically everyone. I make all of the developers on our team do them too:<p><a href="http:&#x2F;&#x2F;cryptopals.com" rel="nofollow">http:&#x2F;&#x2F;cryptopals.com</a>
评论 #14042507 未加载
bsder大约 8 年前
So, what&#x27;s the recommendation for an Authenticated Key Exchange?<p>I see a lot of &quot;don&#x27;t use&quot; but I don&#x27;t see any &quot;do use&quot; for that case.
jasdeepsingh大约 8 年前
May be on a tangent and a shameless plug, but I just posted <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14042150" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14042150</a> this morning.<p>Underlock is a small Ruby library that helps with Encrypting&#x2F;Decrypting of files and other data.
评论 #14043429 未加载
nommm-nommm大约 8 年前
OWASP (non-profit)<p><a href="https:&#x2F;&#x2F;www.owasp.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.owasp.org&#x2F;</a><p>NIST (government)<p><a href="https:&#x2F;&#x2F;www.nist.gov&#x2F;publications&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nist.gov&#x2F;publications&#x2F;</a>
评论 #14042441 未加载