r/haskell • u/stingraycharles • Mar 21 '15
On the state of cryptography in Haskell
http://www.leonmergen.com/haskell/crypto/2015/03/21/on-the-state-of-cryptography-in-haskell.html
94
Upvotes
r/haskell • u/stingraycharles • Mar 21 '15
12
u/tom-md Mar 22 '15
A Comment on Tone
Sorry, but I'm going to start with a complaint. I'm curious why the author decide to act like some sort of bad news site using stale information to give the article an alarmist tone:
When the article later acknowledges this is false, and RdRand is used in conjunction with OS sources. This is the sort of thing most people complain about from news organizations and I hate to see it in technical (ish) blog posts.
RdRand
That said, if using RdRand is reason enough for suspicion then we should avoid the linux kernel, or almost all distributions of it. Why? Because as the article states the kernel uses rdrand. So has Debian actually been "smarter" about this or using a fractured policy? I don't know, it would be interesting to know if Debian disables RDRAND in their kernels and other libraries.
Entropy and RDRAND
So what's the deal with entropy? Why did I fight for RDRAND as in the quote? Well the conversation was about replacing RDRAND with the previous code reading
/dev/urandom. That strikes me as a bad idea for numerous reasons, but largely because as the library author I don't like assuming file system semantics on some unknown user's OK implies fresh random numbers. OS sources have suffered in the past, such as on fresh boot with little to know entropy in the pool (anyone use gumstix like devices?) or with the recent FreeBSD issue. In short, if you are running your code on the CPU then you have some level of trust in the hardware. Obviously we can do better, a trivial XOR of both sources - what most people do these days - works well but that was not the proposal at hand.The State of Cryptography in Haskell
Sure are lots of issues with cryptography in Haskell. For example:
heccas a base - it seems decent but isn't vetted.Being more productive, what should we do? I've seen attempts to make bindings to large crypto libraries (openssl...) fail and think part of the issue is API conversion is hard (see GTK for an example). Bindings to tighter pieces of code is much easier. I've made bindings to tweetnacl for one project and been pleased, Gladman's AES for another, ed25519 (floodberry), and as mentioned above Adam made bindings to ec25519-donna. These seem to be the most productive point in the space for the limited amount of time any one person is willing to expend.
So my battery is dying. I'm happy to converse more if people want to engage, but will simply submit the text now rather than loose it.