A Vulnerability in Libsodium

https://news.ycombinator.com/rss Hits: 24
Summary

Libsodium is now 13 years old! I started that project to pursue Dan Bernstein鈥檚 desire to make cryptography simple to use. That meant exposing a limited set of high-level functions and parameters, providing a simple API, and writing documentation for users, not cryptographers or developers. Libsodium鈥檚 goal was to expose APIs to perform operations, not low-level functions. Users shouldn鈥檛 even have to know or care about what algorithms are used internally. This is how I鈥檝e always viewed libsodium. Never breaking the APIs is also something I鈥檓 obsessed with. APIs may not be great, and if I could start over from scratch, I would have made them very different, but as a developer, the best APIs are not the most beautifully designed ones, but the ones that you don鈥檛 have to worry about because they don鈥檛 change and upgrades don鈥檛 require any changes in your application either. Libsodium started from the NaCl API, and still adheres to it. These APIs exposed high-level functions, but also some lower-level functions that high-level functions wrap or depend on. Over the years, people started using these low-level functions directly. Libsodium started to be used as a toolkit of algorithms and low-level primitives. That made me sad, especially since it is clearly documented that only APIs from builds with --enable-minimal are guaranteed to be tested and stable. But after all, it makes sense. When building custom protocols, having a single portable library with a consistent interface for different functions is far better than importing multiple dependencies, each with their own APIs and sometimes incompatibilities between them. That鈥檚 a lot of code to maintain. It includes features and target platforms I don鈥檛 use but try to support for the community. I also maintain a large number of other open source projects. Still, the security track record of libsodium is pretty good, with zero CVEs in 13 years even though it has gotten a lot of scrutiny. However, while recently experiment...

First seen: 2025-12-30 19:04

Last seen: 2025-12-31 18:08