Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Constant-Time comparison [closed]

A relatively simple question:

It appears that C# doesn't come with baked-in constant-time comparison methods or extensions, why not? Sure it's a simple algorithm, but it seems so basic it should be included.

It is typically not recommend to write any of your own crypto code, however it appears that there aren't any libraries for this kind of purpose, am I missing some?

See algorithms like this: http://codahale.com/a-lesson-in-timing-attacks/

like image 201
StrangeWill Avatar asked Oct 06 '15 03:10

StrangeWill


1 Answers

Since it's being removed as off-topic, I'm moving my answer here: https://blog.roushtech.net/2017/05/25/constant-time-comparisons-net/

like image 155
StrangeWill Avatar answered Sep 20 '22 15:09

StrangeWill