(Android) Networking and Cryptography Library (NaCL) JNI binding
Java Shell Makefile Other
Failed to load latest commit information.
example/Sodium Added example application May 4, 2016
jni Enable mips64 support. Feb 14, 2017
keys gpg key Feb 20, 2017
libsodium @ e329f0a comment out for now Feb 6, 2017
src Work around Android implementation bug where the default File.createT… Feb 15, 2017
.gitignore Upgrade to "externalNativeBuild". Feb 8, 2017
.gitmodules branch stable May 25, 2016
.travis.yml dependencies script Feb 26, 2017
Dockerfile rng-tools Feb 20, 2017
LICENSE.txt Formatting on headers Mar 31, 2013
README.md version 1.0.6 Feb 20, 2017
android-emulator.sh Replace workaround. Feb 26, 2017
build-kaliumjni.sh setenv Feb 21, 2016
build-libsodiumjni.sh gradle build quiet Sep 2, 2016
build-linux.sh add gradle build to build-linux Feb 26, 2017
build-mac.sh mac env Feb 21, 2016
build.gradle Merge branch 'master' into feature_wider_testing Feb 24, 2017
build.sh use libsodium stable branch Feb 11, 2017
check-ndk-api.sh check ndk api Sep 2, 2016
commands.md commands Feb 20, 2017
dependencies-linux.sh Merge branch 'ndk-r13b' into develop Feb 11, 2017
dependencies-mac.sh update brew first Sep 2, 2016
dependencies.sh dependencies script Feb 26, 2017
docker-compose-build.yml docker compose run and build Dec 20, 2016
docker-compose.yml gpg key Feb 20, 2017
docker-copy-files-to-host.sh docker links Dec 13, 2015
download-gradle.sh ANDROID_SDK_VERSION Feb 24, 2017
enter.sh linux build Feb 21, 2016
gradle.properties signing properties gradle Feb 20, 2017
libsodiumjni.rb build mac with brew Feb 21, 2016
pom.xml updating plugin versions. release repo Feb 20, 2017
release.txt mvn deploy jar Feb 17, 2016
setenv.sh refactor env variables setup Feb 27, 2017
settings.xml gpg passphrase property Feb 20, 2017
singleTest.sh mvn quiet Sep 2, 2016
travis.sh osx blank for now Feb 26, 2017
update-android.sh Install android SDK packages "tools", "platform-tools". Feb 19, 2017


Build Status

libsodium-jni - (Android) Java JNI binding to the Networking and Cryptography (NaCl) library

A Java JNI binding (to allow for Java and Android integration) to Networking and Cryptography library by Daniel J. Bernstein.

If you do use this project in your research project, please do cite this repo. Thanks!

Credits to:


  • Java package is under org.libsodium.jni
  • Maven coordinates are in the Sonatype OSS repository

Android Archive (AAR)


Java Archive (JAR)


MacOS Manual Compilation and Installation

Install brew

Run ./build-mac.sh

Linux Manual Compilation and Installation

Run ./build-linux.sh

To use the example app

Clone the repo and import project from folder example/Sodium in Android studio (Android studio 2.1). Android studio will handle the rest. Compile and run. Tested to emulators down to Android Version 16.

AAR usage

To use the AAR project as is (No .SO file imports needed).

It is also possible to build the AAR library yourself using the provided scripts linux or mac. After building the library open module settings and add the libsodium-jni-release.aar and/or libsodium-jni-debug.aar as a dependency.

Custom code usage

To use the library with your own custom code, skip the aar file and add

  1. The native .SO libraries in your project (Create jnilibs folder and make the required changes to the gradle file)
  2. Add the source code from the src folder and add your own additional code.

Docker Container

The docker container is available from libsodium-jni which is a Automated Build.

Manual compilation and installation

Please refer to the docker build for the commands used to build.


Docker container

Issues / Improvements / Help Seeked

libsodium-jni is currently being used in production. Feedback, bug reports and patches are always welcome.

Everything has been tested and working on ubuntu 12.04 32bit and 64 bit, macos, and Android

gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 4524D716