Javascript Crypto Is Useful
In 2014, I wrote my first Javascript crypto library. Since then I've designed and written many such libraries - eight of which have been deployed in popular Google products and services. Javascript crypto can help solve many problems, some of which I'm going to discuss in this post. Some people have strong feelings about Javascript crypto, and with good reasons. Writing crypto code in Javascript is difficult, because of the lack of types and the permissive nature of the run-times. You can always shoot yourself in the foot if you don't know what you're doing in any languages, but you don't even hear the shot in Javascript: the run-times don't usually complain, but they just silently give you an incorrect result. For example, if you have an array x of 10 elements, accessing x[10] or x[11] won't throw an out of bound exception, but return undefined. This behavior is hostile to crypto code, as demonstrated in this neat exploit discovered by Bleichenbacher,...