HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jedisct1
libsodium
C2013–2023
jedisct1 / libsodium

libsodium

A modern, portable, easy to use crypto library.

51Distinct people
59Mentions
0Explicit recommenders
14.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A modern, portable, easy to use crypto library.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 12:01:57 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year59 dated mentions

Observed mentions: 2013-03-07 09:31:27 UTC to 2023-09-15 09:52:20 UTC.

0510152013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 13 mentions; 4 submissions, 9 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 2 submissions, 3 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC303
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC1349
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC707
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC505
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC615
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC615
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC716
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC404
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC523

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Sodium is an easy-to-use software library that provides a wide range of cryptographic operations including encryption, decryption, digital signatures, and secure password hashing. It is a portable, cross-compilable, installable, and packageable fork of NaCl. While maintaining API compatibility, libsodium extends functionality to improve usability and simplify the development of secure applications. Key Features Encryption & Decryption: Securely encrypt and decrypt data with modern algorithms. Digital Signatures: Create and verify signatures to ensure data authenticity. Cross-Platform Compatibility: Supported on Windows (MinGW and Visual Studio, x86, x64 and arm64), iOS, Android, JavaScript, and WebAssembly. User-Friendly API: Designed to provide all core cryptographic operations while remaining easy to integrate into your projects. Documentation Installation Quickstart Full Documentation Releases Integrity Checking Versioning libsodium uses a two-tier release system: Point releases (e.g., 1.0.19, 1.0.20, 1.0.21) are tagged when new features are added or significant changes are made. Stable releases are frequent maintenance updates between point releases. They fix minor issues while remaining fully compatible with their parent point release. No new features, no breaking changes. If your application depends on a specific point release, stable updates are safe to apply. Security fixes go to the stable branch immediately, with a new point release tagged shortly after. Contributors Code Contributors This project thrives thanks to the valuable contributions from our community. View all the contributors: Financial Contributors Your financial support helps us sustain and further develop libsodium. Become a Financial Contributor Individuals Organizations Support libsodium with your organization and gain visibility through your logo and website link. Support with Your Organization License This project is distributed under the ISC license.
Read the full README on GitHub

What Hacker News says

7 sources
brugeman·Nov 25, 2020Submission

Show HN: A file server for Android, end-to-end encryption, web access

Recently I've been playing with an idea of a file server on my Android phone, with a web browser access. I wanted to replace: - AirDroid - sending files to my own PC or laptop. - ShareIt - sending big files over the local network to my family devices. - Dropbox - sharing select files with other people over the Internet. Requirements I had in mind: - end-to-end encryption, no sign ups, no accounts, no passwords - local connection if devices are on the same network - asynchronous access, server should work seamlessly in the background This week I finally managed to stitch the pieces together and get something usable and useful. I now have full access to my phone on my laptop browser, I can share files with a link without uploading to the cloud, and the local network is used whenever possible. The file server app is on the PlayStore[1], web-
Read the rest
client is here[2], and you can check out the roadmap[3]. Shoutouts to these great tools that made it possible: - libsodium[4], and it's JS version, are used for the end-to-end encryption - StreamSaver.js[5], to save large files from a non-HTTP transport without buffering it in RAM. Had to patch it to add back pressure when the download is paused. Current limitations: - p2p only works on local networks, wait until WebRTC transport is implemented in the server - when downloading several files, a Zip is generated, with a 4Gb size limit, wait until I figure out the way to fix this. With a single file, it's downloaded in plain and without limits. Please roast this thing! -- [1] PlayStore: https://play.google.com/store/apps/details?id=im.recall.android [2] Web client: http://web.recall.im [3] Roadmap: https://recall.im [4] LibSodium: https://github.com/jedisct1/libsodium [5] StreamSaver.js: https://github.com/jimmywarting/StreamSaver.js [*] A demo of some files I shared, served by my phone: http://web.recall.im/#peer=c7e0f38a7f60752b4fa3017807fc731f2c8cb87b3d7d35c8131196c…
20 points · Open discussion
>I of course agree with all of this, but as someone pretty much at the bottom of the food chain who just wants to encrypt some data, there's often no libraries that safely glue the primitives together in the way that I require. >I hope this doesn't come off as entitled, but I feel like the best way to get people to stop rolling their own crypto is to provide more/better libraries. Author here. I mentioned libsodium [1] and Tink [2]. We started Tink because we want to provide more/better libraries. >Granted, this is getting better, for example NaCl's crypto_box[0] is awesome and very hard to misuse. But say you want forward secrecy now. chirp, tumbleweed. It looks like you want to build an interactive protocol. I'm not sure if libsodium has a solution, but Tink doesn't. So far we've been focusing on encryption at rest. Can you tell me more
Read the rest
In So you want to roll your own crypto?
Tink addresses things libsodium doesn't really do. Native support for AWS Key Management System and its equivalent on other cloud platforms is a huge win; we should all be using more of these. But libsodium would have to start mandating a TLS library and an HTTP library and whatnot, interfering with people's existing setups; you can't really do that without C programmers getting angry at you. It deals with not only key generation, but also key serialization. libsodium kind of strands you when it comes to the question how to actually store keys. Deterministic nonces have also been something that libsodium appears to have rejected: https://github.com/jedisct1/libsodium/issues/392 If you're looking at it from a misuse-prevention perspective, Tink is probably a major step up that accounts for modern use cases. libsodium's kind of in a lower l
Read the rest
evel niche and suffers from being held back by C and its notoriously anemic standard library.
In Tink – Cryptographic APIs that are secure, easy to use correctly
Speaking vaguely of this topic, the ciphersuite of WireGuard: How much trouble do you think it would be for a CPU designer to include a ChaCha20 accelerator or some sort of round/double-round/quarter-round³ primitive? It seems like the cost would be an order of magnitude lower than something like an AES accelerator, and way easier to validate. I keep wondering if it's going to be this year, the next, or the one after that; but ChaCha20† is getting really popular, so I can imagine something like this could be very valuable, especially on a chip for an infrastructure provider like CloudFlare‡ , or any VPN megacompany. † which may have more rounds than necessary, good reason not to do all 20 in one primitive if that costs latency/throughput ‡ who use ChaCha-based TLS for devices with poor, nonexistent, or misconfigured AES accel. ³ this rela
Read the rest
In Why not “Why not WireGuard?”
> So yes, like I said, you can force a particular behavior, and throw out any system for which that doesn't come naturally Find me one system in current use (2020) that isn't 2's complement. > you just made the language more complex for them. Ah, but I was never talking about implementation complexity. I was talking about specification complexity. Imposing 2's complement makes the specification simpler. No special case, no boundary. Just a binary field. Undefined behaviour draws such a boundary. An extra detail to specify and remember. Some thing that reminds you you're not quite doing modular arithmetic. > Eh. You did nothing about undefined behavior. It's still there. I did. There's less of it. I've filled the bug, here's what's this about: https://github.com/jedisct1/libsodium/issues/937 Here's the relevant quote from annex J of the (h
Read the rest
eavy, I have printed it) C99 specifications: Addition or subtraction of a pointer into, or just beyond, an array object and an integer type produces a result that does not point into, or just beyond, the same array object. (6.5.6) That's what caused the bug: we were taking a pointer from an array, then used it to overflow past it. It didn't matter that we could access the memory there. What mattered is that we locally overflew that array. Had we computed the pointer by first working with the outer array, then pointed to the right element, we'd have the same pointer, except this time it wouldn't be undefined. Bonus note: you don't even have to dereference the pointer, computing its value is enough to trigger undefined behaviour. Here is some more undefined behaviour I have removed (it's subtle, relatively few programmers know this): Pointers that do not point into, or just beyond, the same array object are subtracted. (6.5.6) There go flat memory models. Though to be honest, even segmented memory models could define that. Just make the subtraction already, it doesn't have to mean anything. Make it unspecified or implementation defined at least. Pointers that do not point to the same aggregate or union (nor just beyond the same array object) are compared using relational operators (6.5.8) That's the reason we can't implement memmove() portably and efficiently. And depending which tool you ask, even converting the pointers to intptr_t first isn't enough. Real world example here: https://github.com/jedisct1/libsodium/commit/e7e378fad116c18... --- If you haven't already, go read the annex J from the C standard. Ponder the fact that compilers, unless you specifically ask not to (-fwrapv), will exploit every single one, even on platform that could define some reasonable behaviour (2's complement machines). It may hint at how hostile C is to programmers who care about correctness. Believe me, I know. I wrote a whole Crypto library[1], and that's one of the easiest things to get right, where C is concerned. I mean, the crypto itself is hard, but the total lack of dependency makes it pathologically easy to write in a portable way. Yet C still makes it hard. [1] https://monocypher.org
In Why I’m Using C
> I've pointed this problem out early last year to libsodium, but they chose to ignore it. I'm guessing you're referencing this [0]. libsodium's response that your suggestion wasn't enough seems reasonable, as does their response: > `sodium_memzero` should be considered as best-effort, with reasonable tradeoffs. The documentation for memzero [1] doesn't read like it works 100% of the time, no matter what. It reads like there are tradeoffs involved. > My memset_s does a full memory barrier, but no others do. Esp. the so-called "secure" libs. Your memset_s also doesn't work on big endian, whilst "the so-called 'secure' libs" often do. I'm fine with self-promotion, but don't disparage efforts that have a much larger surface that they deal with, simply because you disagree with the tradeoff they find acceptable. A one-liner isn't enough for t
Read the rest
In CacheOut: Leaking Data on Intel CPUs via Cache Evictions

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.