Hacker News new | comments | show | ask | jobs | submit login

I'm fairly confident I can write a bug free crypto library. Monocypher is probably already bug-free.

On the other hand, I don't see how I can ensure my library is bug-free without external help.

"Probably bug free" is not good enough. I need over 99.9% certainty, and I'm currently pretty far from that.




I would be careful with statements like this, largely because the question of what 'bug free' means is real.

Do you mean that the crypto algorithms work as advertised? e.g. would DES after public knowledge of differential cryptanalysis be okay?

Do you mean that you have implemented algorithms exactly as specified?

Do you mean that you have implemented algorithms exactly as specified that are also constant time so that they resist timing attacks?

Do you mean that you have implemented algorithms exactly as specified that are not vulnerable to cache eviction attacks on shared hardware?

Do you mean that you have implemented algorithms exactly as specified that resist bit-flip attacks or SDR attacks, or audio attacks, or other Van Eck style listening?

I'm actually not trying to be down on your work. It's hard work, and the world needs more people who actually do it. I'm just saying it is VERY hard to feel confident, and as someone who has a passing interest in this kind of security, I worry when I read statements like you made.


Exactly as specified, and immune to timing attacks including cache eviction. I make no claim about other side channels, or the strength of the primitive themselves —though I did pick strong primitives.


:)


Probably not what you had in mind, but if there's a 0.1% that you have a bug in any given line (let's assume that includes bugs in how lines interact as well) - there's about a 63% chance there's at least one bug for every 1000 lines of code, if my math isn't off.

That's mostly to say: I agree with your assessment that you (and me and everyone) need help to review code and look for bugs.




Applications are open for YC Winter 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: