Maintaining cross-platform cryptographic library is a journey full of unexpected bugs, language-specific hacks, difficult decisions and endless struggle to make developer-facing APIs easy-to-use and hard-to-misuse.
As developers, what do we want from using cryptographic tools? They should be easy-to-use and hard-to-misuse, cover complete use-cases instead of providing raw crypto-primitives, support language-specific style, work in the same way on numerous platforms and languages. Basically, we want less stress and more work done.
Click to read slides.But is it so easy to maintain cross-platform crypto library?
How to simplify complex crypto concepts into simple encrypt(msg, key)
and decrypt(data, key)
functions? How to provide a unified API for 12 languages, when some of them are strongly-typed and the other one is javascript? Secure by default: what design choices should be made to protect from misuse. Multi-platformness: how to make sure that message encrypted using Ruby on x64 Ubuntu 18.04 will be successfully decrypted on iOS12 on iPhone armv7s? Testing wildness: static analyzers, fuzzing, unit tests, integration tests. Docs: developers copy-paste from readme anyway, how to make sure that they copy-paste correct things.
I’ll describe the 4yrs experience on maintaining multi-platform open source library Themis: from API design to language-specific hacks.
size_t
.This talk is useful for people that believe that perfect crypto lib is a C lib with 1-page readme :)