TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Everything you need to know about cryptography in 1 hour (2010) [pdf]

275 pointsby epsylonalmost 11 years ago

16 comments

techpeacealmost 11 years ago
Video link: <a href="http://blip.tv/fosslc/everything-you-need-to-know-about-cryptography-in-1-hour-3646795" rel="nofollow">http:&#x2F;&#x2F;blip.tv&#x2F;fosslc&#x2F;everything-you-need-to-know-about-cryp...</a><p>Previous discussion here: <a href="https://news.ycombinator.com/item?id=1346711" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1346711</a><p>And here: <a href="https://news.ycombinator.com/item?id=2253336" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=2253336</a>
cpercivaalmost 11 years ago
The reason this is being (re)posted now is that I gave this talk at a Polyglot Vancouver meetup last night. Freed from the constraint of a conference schedule I actually took about 90 minutes to go through this talk this time (followed by another 30 minutes of questions).
评论 #7884417 未加载
评论 #7886075 未加载
评论 #7885483 未加载
评论 #7885025 未加载
评论 #7884683 未加载
sottealmost 11 years ago
Here is the video of the talk: <a href="http://www.fosslc.org/drupal/content/everything-you-need-know-about-cryptography-1-hour" rel="nofollow">http:&#x2F;&#x2F;www.fosslc.org&#x2F;drupal&#x2F;content&#x2F;everything-you-need-kno...</a>
评论 #7884293 未加载
drdaemanalmost 11 years ago
&gt; DON’T: Put FreeBSD-8.0-RELEASE-amd64-disc1.iso and CHECKSUM.SHA256 onto the same FTP server and think that you’ve done something useful.<p>Actually, this is a bit wrong - it&#x27;s just that this is not cryptography and security-related and doesn&#x27;t have anything to do with authentication. It&#x27;s the same reason why some fansubbers still include CRC32 into filename - basic <i>unauthenticated</i> integrity checking. Totally insecure, but still better than nothing.<p>I had case where downloaded file was broken - for some weird case either software, storage or a network had failed but TCP&#x2F;IP checksumming didn&#x27;t help and the fact was, I had wrong bits on the hard drive. I hadn&#x27;t broadband connectivity at home and that cryptographically-pointless CHECKSUM.SHA256 (well, actually it was MD5) helped to find that out before I left the library.<p>And recently, the same concept had helped me to validate files with a faulty cloud storage service that managed to lose some chunks and silently replaced them with zeroes when I tried to download the data back.<p>Obviously, a signed file stored on another server would always be a better idea.<p>Just nitpicking.
apialmost 11 years ago
I used Poly1305, but <i>exactly</i> in the way Daniel J. Bernsetein used it in his NaCl library. I also used his ECC signature scheme, also in exactly the same way. :)<p>As far as I can tell the gotcha with Poly1305 is that you absolutely cannot reuse the same key <i>ever</i>. His construction involves using your keyed cipher to create 32 random bytes by encrypting 32 zero bytes before encrypting the actual message. These random bytes are then used as the one-time-use Poly1305 key. In NaCl he does this with either Salsa20 or AES-CTR, both of which are stream ciphers. (CTR converts a block cipher into a stream cipher.)
asciimoalmost 11 years ago
Here&#x27;s a provocative gem:<p>&gt; The purpose of cryptography is to force the US government to torture you.
评论 #7884382 未加载
评论 #7884818 未加载
评论 #7885262 未加载
drewcrawfordalmost 11 years ago
Would be interested in hearing more detail about your objections to both Poly1305 and ECC.
评论 #7884594 未加载
lisperalmost 11 years ago
&gt; PROBABLY AVOID: Elliptic Curve signature schemes.<p>Including Ed25519?
评论 #7884723 未加载
评论 #7885243 未加载
tptacekalmost 11 years ago
I disagree with two big points in this talk, but I&#x27;m sorry to say they&#x27;re the same two things I disagreed with last time, so this is going to be a boring comment.<p>First, dedicated AEAD cipher modes are superior to manually composing AES-CTR and HMAC-SHAx. AEAD modes provide both authentication and encryption in a single construction. AES-CTR+HMAC-SHAx involves joining two constructions to do the same thing.<p>Colin points to AES-GCM, the most popular AEAD mode, as an example of how AEAD modes can be more susceptible to side-channel attacks than AES-CTR+HMAC-SHAx. I don&#x27;t think this is a strong argument for a couple reasons:<p>* AES-GCM is so far as I can tell no practical cryptographer&#x27;s preferred AEAD mode; &quot;whipping boy&quot; might be a better role to ascribe to it.<p>* AES-GCM&#x27;s side-channel issues are due principally to a hardware support concern (GMAC, AES-GCM&#x27;s answer to HMAC, requires modular binary polynomial multiplication, which in pure software is table-driven, which creates a cache timing channel). That hardware support concern might be receding, and platforms that don&#x27;t have AES-GCM might prefer a different AEAD mode anyways.<p>* Modern AEAD modes, of the sort being entered into CAESAR, have resilience against side channels as a design goal.<p>* But the most important rejoinder to Colin&#x27;s preference for HMAC-SHAx over AEAD modes is this: HMAC-SHAx is responsible for more side-channel flaws than any other construction. Practically every piece of software that has implemented HMAC-SHAx has managed to introduce the obvious timing channel in comparing the candidate to the true MAC for a message. What&#x27;s worse is, using AES-CTR+HMAC-SHAx in practice means that the developer has to code the HMAC validation themselves; it&#x27;s practically an engraved invitation to introduce a new timing leak. Almost nobody codes their own AES-GCM.<p>I also think Colin is wrong about ECC, particular versus RSA.<p>RSA might be the most error prone cryptographic primitive available to developers. There are two big reasons for this:<p>* RSA has fussy padding requirements. The current best practices for RSA encryption and signing are OAEP and PSS (huge credit to Colin for getting this right in 2010). If you want to form an opinion about RSA, go read up on OAEP and ask yourself (honestly) if you would come up with anything resembling OAEP if you were called on to encrypt with RSA. Developers as a rule do not use OAEP; instead, most new software <i>still</i> uses PKCS1v15 padding, which introduces susceptibility to terrible vulnerabilities that can often be easily exploited in the wild. Even better are the Javascript developers who build RSA from first principles and skip the padding altogether (the fact that RSA padding is a requirement and not an annoyance to be avoided is why Nate Lawson says we should call it &quot;RSA armoring&quot; and not &quot;RSA padding&quot;).<p>* RSA easily supports a direct encryption transform, which is widely used in practice. ECC software as a general rule does not synthesize an encryption transform from the ECDLP; instead, ECC software uses the ECDLP to derive a key, and then uses something like AES to actually encrypt data. You might be thinking, &quot;that&#x27;s how RSA software works too&quot;. But RSA in practice is subtly different: you can, for instance, easily encrypt a credit card number directly using RSA, or build a crappy key exchange protocol where the client encrypts (doesn&#x27;t derive or sign, but encrypts) a key for the server. RSA and conventional DLP crypto therefore offer (encrypt, key-exchange, sign); ECC in practice offers just (key-exchange, sign). That&#x27;s one less dimension of things developers have to get right in ECC cryptosystems.<p>Colin is smarter than me and much better trained in cryptography than I am. All I do is find and exploit crypto bugs in real software. I am usually as nervous as any of you are to challenge Colin about crypto, but I think I can win these two arguments. (Spoiler alert: Colin doesn&#x27;t think so).
评论 #7885996 未加载
评论 #7887843 未加载
评论 #7903796 未加载
Spearchuckeralmost 11 years ago
Thanks for sharing the slides (and techpeace for the links to the video).<p>A question I have though is given that we (those of us who collectively don&#x27;t identify ourselves as security rocket-surgeons) are always advised to stick with the high-level stuff and to stay away from stuff like AES (ref. slide 16), which nobody does anyway, then why is no mention ever made of established and known protocols? Examples like<p>- Needham-Schroeder (fixed version), <a href="http://en.wikipedia.org/wiki/Needham-Schroeder_protocol" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Needham-Schroeder_protocol</a><p>- Otway-Rees, <a href="http://en.wikipedia.org/wiki/Otway%E2%80%93Rees_protocol" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Otway%E2%80%93Rees_protocol</a><p>have proven to be really useful. Yes, there&#x27;s a metric ton of work involved in implementing something like this, but going through it once is amazing practice for getting it right in future (that, at least, is my experience).<p>Why is it that we talk about symmetric and asymmetric encryption, but never go as far as the protocols that provide <i>real</i> context for their uses?
scott_karanaalmost 11 years ago
There weren&#x27;t any &quot;Don&#x27;ts&quot; about compression.<p>Is that solely an SSL&#x2F;TLS concern, or is it generally applicable to cryptosystems?
mmastracalmost 11 years ago
He recommends HMAC-SHA256 in this paper, but I think that AES-GCM is a better construction, as long as you understand the requirements for IV uniqueness. It offers significant improvements on top of the standard HMAC (privacy and additional out-of-band data) without adding much in terms of size.
评论 #7884563 未加载
评论 #7884768 未加载
评论 #7884457 未加载
maxtacoalmost 11 years ago
Good suggestion to avoid PKCS v1.5; sadly PGP requires it: <a href="http://tools.ietf.org/html/rfc4880#section-13.1" rel="nofollow">http:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc4880#section-13.1</a>
Nimialmost 11 years ago
&quot;&quot;&quot;Conventional wisdom: Don&#x27;t write cryptographic code!<p>Use SSL for transport&quot;&quot;<p>Honest question here: suppose I have a webapp with multiple servers, being load-balanced through Amazon&#x27;s ELB. This sounds about as standard as it can get. Question is: how does one handle client migration between servers, and client authentication, without writing cryptographic code or knowing anything about cryptography?<p>(apologies if this is trivial)
评论 #7888543 未加载
NAFV_Palmost 11 years ago
Disclaimed: I know sweet f-a about cryptography, and was expecting 100% of this pdf to go straight over my head.<p>On the other hand, why is the author using &quot;i++&quot; in a preamble of a for loop?
评论 #7888622 未加载
graycatalmost 11 years ago
He doesn&#x27;t know how to write even simple mathematics. E.g., he uses symbols <i>n</i> and <i>k</i> without definition. Without careful definitions right there in the context, such symbols mean nothing. He is not clear enough about what he means by <i>x</i>.<p>His lack of precision in his writing lowers confidence in the quality of what he has written.
评论 #7885989 未加载
评论 #7886054 未加载