explaingit

jedisct1/libsodium

13,673CAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A widely trusted cryptography library that lets developers add encryption, digital signatures, and secure password storage to apps without needing deep security expertise.

Mindmap

mindmap
  root((libsodium))
    What it does
      Encrypt data
      Digital signatures
      Password hashing
      Tamper detection
    Platforms
      Windows
      iOS and Android
      Web via WASM
      Linux
    Tech Stack
      C
      WebAssembly
      JavaScript
    Audience
      App developers
      Security engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Encrypt messages in your app so only the intended recipient can read them.

USE CASE 2

Store user passwords securely so that even if your database is stolen, the passwords cannot be recovered.

USE CASE 3

Add digital signatures to files or messages so recipients can verify they have not been tampered with.

USE CASE 4

Use the same cryptography code across iOS, Android, Windows, and web browser targets from a single library.

Tech stack

CWebAssemblyJavaScript

Getting it running

Difficulty · moderate Time to first run · 30min

Requires compiling from source or using a pre-built package, WebAssembly and JavaScript builds need an additional build step.

ISC license: use freely for any purpose, including commercial use, with no restrictions beyond keeping the copyright notice.

In plain English

Libsodium is a software library that handles cryptographic operations, meaning things like encrypting data so only the intended recipient can read it, verifying that a piece of data has not been tampered with, creating digital signatures, and storing passwords securely. It is written in C and is used by developers who need to add security features to their applications without having to understand the deep mathematical details of cryptography themselves. The library is designed to work on a wide range of platforms: Windows (both 32-bit and 64-bit, as well as ARM), iOS, Android, and even in web browsers via WebAssembly and JavaScript. This makes it useful for projects that need to run in many different environments. Libsodium started as a fork of NaCl (a well-regarded cryptography library), and it maintains compatibility with NaCl while adding features that make it easier to install and package. The goal has always been to keep the interface straightforward so developers make fewer security mistakes. The project follows a two-tier release schedule. Regular point releases add new features or significant changes. Between those, stable releases handle small bug fixes and maintenance without breaking anything or adding new behavior. Security patches go to the stable branch right away. The library is free to use under the ISC license, which is a short, permissive open-source license. If you are a developer building an app that needs to encrypt data or verify identities, libsodium is a widely trusted option with thorough documentation available at doc.libsodium.org.

Copy-paste prompts

Prompt 1
Show me how to encrypt and decrypt a string in C using libsodium's crypto_secretbox_easy function.
Prompt 2
How do I use libsodium in a Node.js project via WebAssembly to hash passwords with Argon2?
Prompt 3
Write a Python binding example that uses libsodium to generate a key pair and sign a message.
Prompt 4
How do I cross-compile libsodium for Android ARM and link it into an Android NDK project?
Open on GitHub → Explain another repo

← jedisct1 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.