libsodium VS cryptography

Compare libsodium vs cryptography and see what are their differences.

libsodium

A modern, portable, easy to use crypto library. (by jedisct1)

cryptography

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. (by pyca)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
libsodium cryptography
30 70
11,927 6,291
- 2.6%
8.7 9.9
3 days ago 4 days ago
C Python
GNU General Public License v3.0 or later GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

libsodium

Posts with mentions or reviews of libsodium. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-14.
  • Libsodium: A modern, portable, easy to use crypto library
    1 project | /r/hackernews | 18 Sep 2023
    1 project | /r/patient_hackernews | 16 Sep 2023
    9 projects | news.ycombinator.com | 14 Sep 2023
    Libsodium has been around for a while, so probably the reason it was posted is that version 1.0.19 was just released: https://github.com/jedisct1/libsodium/releases/tag/1.0.19-RE...

    Updated NuGet and Swift packages are going to be uploaded soon.

    AEGIS-128X and 256X are not there yet, but if you need them, they are available in libaegis: https://github.com/jedisct1/libaegis

    All the code from libaegis will eventually be merged into libsodium, including the incremental update API which is especially useful for TLS.

  • Libsodium 1.0.19 Released
    1 project | news.ycombinator.com | 13 Sep 2023
  • FLaNK Stack Weekly for 20 June 2023
    34 projects | dev.to | 20 Jun 2023
  • Libsodium Still Relevant and Maintained?
    1 project | /r/crypto | 21 May 2023
    To version the dependency you can check the current stable tree in git and save the date and git hash.
  • I created an encrypted command line jounal
    2 projects | /r/commandline | 22 Apr 2023
    To address both of these vulnerabilities, you should instead use a library that handles these sharp edges for you. A well received library in the security and cryptography communities is libsodium. It has high level functions that handle password hashing and data encryption for you, reducing the risk that you introduce vulnerabilities in your code, such as you have here.
  • Why can't I burn scam tokens by sending them to 0x000000000000000000000000000000000000dEaD?
    1 project | /r/ethereum | 13 Apr 2023
    In general, cryptography is really hard. So for example, an attacker could construct a message that if you signed would leak information, ie it reduces the space of possible keys such that it can be brute forced. I’m not entirely sure if you could do that with a transfer function. But it’s certainly possible. That said, there are a ton of smart devs trying to prevent that as well so I’m not assuming anything here. But prudent practices are likely good to follow. Be very careful calling anything from your cold wallet etc. Use disposable keys for anything a bit risky. I took a sec to google an example and this is the closest I could find. https://github.com/jedisct1/libsodium/issues/170
  • Some questions from a noob Rustacean
    1 project | /r/rust | 17 Mar 2023
    Hi everyone! I'm learning Rust while on a break between jobs, and as I'm particularly interested in interfacing Rust with C and in cryptography, I've decided to write a wrapper around libsodium (https://github.com/jedisct1/libsodium) in Rust. This is purely a hobby project and I probably won't ever release it as there are already some open-source Rust bindings available for the library.
  • Librandombytes – a public domain library for generating randomness
    2 projects | news.ycombinator.com | 26 Jan 2023
    Can anyone recommend between Librandombytes and libsodium ramdombytes?

    https://github.com/jedisct1/libsodium/tree/master/src/libsod...

cryptography

Posts with mentions or reviews of cryptography. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-25.
  • We build X.509 chains so you don't have to
    5 projects | news.ycombinator.com | 25 Jan 2024
    Congratulations to the authors, this was a feature that was dearly missing from pyca/cryptography. It took a long time to get right.

    For the history: https://github.com/pyca/cryptography/issues/2381

  • “Our paying customers need X, when will you fix it?”
    5 projects | news.ycombinator.com | 15 Jul 2023
    Some context:

    - The cryptography dependency used by the current release of mitmproxy has a CVE related to an OpenSSL vulnerability (https://github.com/pyca/cryptography/security/advisories/GHS...)

    - The main branch of mitmproxy has already upgraded to the latest version of the cryptography package

    - The author of the package does not believe the CVE impacts users of mitmproxy so a release including this commit has not been made

  • Creating a password manager
    1 project | /r/learnpython | 19 Jun 2023
    Also you'll use https://github.com/pyca/cryptography
  • Microservice memory profiling
    2 projects | /r/FastAPI | 28 May 2023
    first, I did see a correlation between an endpoint being heavily hit in a given time window, and an increase of memory usage that didn't went down afterwards. The endpoint didn't do much so I went through every instruction - is a global variable appended indefinitely ? Is a cache decorator growing without a limit set ? Do I use a 3rd party that has a known issue ? Turns out, it was using cryptography, so I looked up known issues. Saw an issue about a leak when using load_pem_x509_certificate https://github.com/pyca/cryptography/issues/4833 - which I used ! I could fortunately just upgrade the library
  • [Python] Poésie vs Pipenv vs. pip-tools: Qu’utilisez-vous?
    1 project | /r/enfrancais | 9 Mar 2023
    Après le kerfuffle du paquet de cryptographie cette semaine (https://github.com/pyca/cryptography/issues/5771), J’ai passé en revue l’état des outils de gestion des dépendances en Python.
  • I love building a startup in Rust. I wouldn't pick it again
    11 projects | news.ycombinator.com | 17 Feb 2023
    > A big problem with Rust, long-term, is that the kind of programs that really need it are somewhat out of today's mainstream. It's not that useful for webcrap. It's not that useful for phone apps. The AI people use Jupyter notebooks and Python to drive code on GPUs.

    One thing this is missing is that Rust is useful for libraries callable by many different languages. You may or may not want to use it to build an actual Web app (I personally think it's a solid choice, but reasonable people can disagree). But for building, say, the Python cryptography library [1], which is used as a part of "webcrap" and Jupyter notebooks, Rust is clearly an excellent option. Nobody is going to build core Python infrastructure in Go or Node, and there will always be a need for plumbing libraries.

    [1]: https://github.com/pyca/cryptography

  • The impossible case of pitching rust in a web dev shop
    1 project | /r/rust | 22 Sep 2022
    Also, I see more and more examples where rust gets included in different technologies using FFI. Ie for python https://github.com/pyca/cryptography for security/performance critical pieces.
  • Azure CTO: “It's time to halt starting any new projects in C/C++ ”
    15 projects | news.ycombinator.com | 19 Sep 2022
    > I am curious. Could you give some more context?

    Probably talking about this: https://github.com/pyca/cryptography/issues/5771

  • Zig, the Small Language
    13 projects | news.ycombinator.com | 7 Sep 2022
  • os independent way to convert ssl crt to pem
    1 project | /r/learnpython | 22 Aug 2022
    You will be hard pressed to find a cryptography library that doesn't depend on openssl. Fortunately openssl bindings can be installed on Windows. One of the more popular libraries for python is cryptography, but it does depend on libssl.

What are some alternatives?

When comparing libsodium and cryptography you can also consider the following projects:

OpenSSL - TLS/SSL and crypto library

PyCrypto - The Python Cryptography Toolkit

Crypto++ - free C++ class library of cryptographic schemes

pycryptodome - A self-contained cryptographic library for Python

mbedTLS - An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.

pyOpenSSL -- A Python wrapper around the OpenSSL library - A Python wrapper around the OpenSSL library

libhydrogen - A lightweight, secure, easy-to-use crypto library suitable for constrained environments.

PyNacl - Python binding to the Networking and Cryptography (NaCl) library

Botan - Cryptography Toolkit

Paramiko - The leading native Python SSHv2 protocol library.

Bcrypt - Modern(-ish) password hashing for your software and your servers

Passlib