Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


A binding to Libsodium for Pharo, updated for Libsodium version 1.0.18.

Build Status Coverage Status Pharo 7.0 Pharo 8.0

The original author is Tony Garnock-Jones, with contributions from Hernán Morales Durand. See Tony's article on the original code for Squeak and Pharo here: There is still a static copy of the original repository of SmalltalkHub to be found here.

Also, Ken Dickey ported this to Cuis Smalltalk a while back:

Since the original implementation by Tony Garnock-Jones, Libsodium has evolved and expanded its functionality, which hasn't been included in this library (yet). See its extensive documentation here:

You can find the original Crypto NaCl site here:

A good description of the motivation for the original Crypto NaCl library can be found here: The security impact of a new cryptographic library (PDF)

Collective Code Construction Contract (C4)

It is Object Guild's intention to use the Collective Code Construction Contract (C4) for collaboration on this project. Please familiarize yourself with its contents when you want to collaborate on Crypto-Nacl.

The C4 states that the project should have clearly documented guidelines for code style. Since these are currently missing (9 November 2020), these will be created as needed and will thus be a work in progress.

We will use incoming issues and pull requests for purposes of learning to apply C4, so please be patient with us :-)

Comments are welcome. You are kindly requested to use the project issue tracker for this purpose.

No Squeak support

Since 2017, the library uses Pharo UnifiedFFI instead of the older FFI library. As a consequence, it is not supported to run on Squeak.

If there is a strong need to re-introduce Squeak support, please create an issue for it. Obviously, the design can be changed to extract the use of Pharo UnifiedFFI and support Squeak's FFI alongside of it, but this will require some work.


The original ConfigurationOfNacl has been replaced with BaselineOfCryptoNacl, which defines the groups core and tests, with the default only loading the core group.

Metacello new
  baseline: 'CryptoNacl';
  repository: 'github://objectguild/Crypto-Nacl:master';

Installing Libsodium

In order to use Crypto-Nacl, you have to have the Libsodium native library installed on the target system.


On macOS, this is done by installing using Homebrew:

brew install libsodium

Ubuntu Linux

On Ubuntu Linux, this is done by installing the libsodium-dev package:

sudo apt-get install -y libsodium-dev


On Windows, you need to download and extract a zip file, and copy the DLL file manually.

  1. Libsodium for Windows can be downloaded from: You probably want the latest stable MSVC release, for example:
  2. Extract the files from the zip file. There are two extracted directories: x64 and Win32. Select x64 for 64-bit or Win32 for 32-bit versions of Windows, and search for libsodium.dll. You can find one inside Release/v142/dynamic/libsodium.dll.
  3. Copy this libsodium.dll file and paste it in C:\Windows\System32.