{"id":37029611,"url":"https://github.com/joshjdevl/libsodium-jni","last_synced_at":"2026-01-14T03:34:02.028Z","repository":{"id":9549669,"uuid":"11456545","full_name":"joshjdevl/libsodium-jni","owner":"joshjdevl","description":"(Android) Networking and Cryptography Library (NaCL) JNI binding. JNI is utilized for fastest access to native code. Accessible either in Android or Java application. Uses SWIG to generate Java JNI bindings. SWIG definitions are extensible to other languages.","archived":false,"fork":false,"pushed_at":"2021-08-17T05:16:40.000Z","size":1507,"stargazers_count":183,"open_issues_count":27,"forks_count":81,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-07-27T07:47:40.985Z","etag":null,"topics":["aar","cryptography","java","jni-bindings","libsodium","nacl","swig"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshjdevl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-16T18:11:22.000Z","updated_at":"2025-05-13T07:40:53.000Z","dependencies_parsed_at":"2022-09-26T21:41:04.137Z","dependency_job_id":null,"html_url":"https://github.com/joshjdevl/libsodium-jni","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/joshjdevl/libsodium-jni","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjdevl%2Flibsodium-jni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjdevl%2Flibsodium-jni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjdevl%2Flibsodium-jni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjdevl%2Flibsodium-jni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshjdevl","download_url":"https://codeload.github.com/joshjdevl/libsodium-jni/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjdevl%2Flibsodium-jni/sbom","scorecard":{"id":534074,"data":{"date":"2025-08-11","repo":{"name":"github.com/joshjdevl/libsodium-jni","commit":"8ddd72e18af4650ac07b52a660fc93de60e58ef1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 6/19 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating ubuntu:xenial to ubuntu:xenial@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T06:28:59.515Z","repository_id":9549669,"created_at":"2025-08-20T06:28:59.516Z","updated_at":"2025-08-20T06:28:59.516Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aar","cryptography","java","jni-bindings","libsodium","nacl","swig"],"created_at":"2026-01-14T03:34:01.363Z","updated_at":"2026-01-14T03:34:02.010Z","avatar_url":"https://github.com/joshjdevl.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **This project is entirely maintained in my spare time. Donations are appreciated:** :clap:\u003cbr/\u003e\u003cbr/\u003e\n\u003e **Bitcoin address:** 1EC6j1f2sDGy9L8ma8FFfQyxt9mb9a6Xxy \u003cbr/\u003e\n\u003e **Bitcoin Cash address:** 1PSxB3DRCkeaZK7nSbJ1hoxbsWAXwM8Hyx \u003cbr/\u003e\n\u003e **Ethereum address:** 2f30c73e8d643356ebbcfee7013ccd03c05097fb \u003cbr/\u003e\n\u003e **Peercoin address:** PQUavHtRCLtevq75GhLCec41nvDtmM4wvf \u003cbr/\u003e\n\u003e **Raiblocks address:** xrb_1dxetbqeo38gcxejt8n6utajorrntbfrr1qftpw7qwarw6d8kp74fwmcuqi9  \u003cbr/\u003e\n\u003e **Monero address:** 48btz6nV4SjWyhDpkXrVVXAtgN6aStdnz8weMyB6qAMhhBVqiy1v3HC6XL1j7K27ZfFRhpw3Y4A4uE8o2PXMxFxY1Q5gGvW\n\n\n[![Build Status](https://travis-ci.org/joshjdevl/libsodium-jni.svg)](https://travis-ci.org/joshjdevl/libsodium-jni)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.joshjdevl.libsodiumjni/libsodium-jni/badge.svg)](https://oss.sonatype.org/#nexus-search;quick~libsodium)\n\n# libsodium-jni - (Android) Java JNI binding to the Networking and Cryptography (NaCl) library \n\nA Java JNI binding (to allow for Java and Android integration) to [Networking and Cryptography](http://nacl.cr.yp.to/) library by [Daniel J. Bernstein](http://cr.yp.to/djb.html).\n\n**Why JNI and not JNA? JNI is much faster than JNA and JNI is faster than JNR.**\n\nIf you do use this project in your research project, please do cite this repo. Thanks!\n\n\u003e Credits to: \u003cbr/\u003e\n\u003e * [**Libsodium**](https://github.com/jedisct1/libsodium): author [Frank Denis](https://github.com/jedisct1) and [Contributors](https://github.com/jedisct1/libsodium/graphs/contributors)\n\u003e * [**Kalium**](https://github.com/abstractj/kalium): author [abstractj](https://github.com/abstractj) and [Contributors](https://github.com/abstractj/kalium/graphs/contributors)\n\u003e * [**Robosodium**](https://github.com/GerardSoleCa/Robosodium): author [GerardSoleCa](https://github.com/GerardSoleCa)\n\u003e * [**libstodium**](https://github.com/ArteMisc/libstodium): author [ArteMisc](https://github.com/ArteMisc)\n\n\n## Installation\n\n* Java package is under `org.libsodium.jni` \n* Maven coordinates are in the Sonatype OSS [repository](https://oss.sonatype.org/#nexus-search;quick~libsodium)\n\n### Android Archive (AAR)\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.joshjdevl.libsodiumjni\u003c/groupId\u003e\n        \u003cartifactId\u003elibsodium-jni-aar\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.1\u003c/version\u003e\n        \u003ctype\u003eaar\u003c/type\u003e\n    \u003c/dependency\u003e\n\n### Android Gradle (AAR)\n1. Add library to dependencies:\n```gradle\n// build.gradle\ndependencies {\n    ...\n    compile 'com.github.joshjdevl.libsodiumjni:libsodium-jni-aar:2.0.1'\n}\n```\n2. To fix the warning [allowBackup](src/main/AndroidManifest.xml), add `xmlns:tools=\"http://schemas.android.com/tools\"` and `tools:replace=\"android:allowBackup\"` to your Manifest:\n```xml\n\u003c!-- AndroidManifest.xml --\u003e\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          xmlns:tools=\"http://schemas.android.com/tools\"\n          package=\"com.name.myapp\"\u003e\n    \u003capplication\n            ...\n            tools:replace=\"android:allowBackup\"\u003e\n        \u003cactivity android:name=\".MainActivity\"\u003e\n            ...\n        \u003c/activity\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\n### Java Archive (JAR)\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.joshjdevl.libsodiumjni\u003c/groupId\u003e\n        \u003cartifactId\u003elibsodium-jni\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.1\u003c/version\u003e\n        \u003ctype\u003ejar\u003c/type\u003e\n    \u003c/dependency\u003e\n\n\n\n### Usage\n#### Java\nExample [invocations](src/test/java/org/libsodium/jni/publickey/AuthenticatedEncryptionTest.java)\n\n* import org.libsodium.jni.NaCl; (this calls System.loadLibrary(\"sodiumjni\");)\n* call NaCl.sodium(). {whatever_method_you_want}\n* Note that Android [allowBackup is set to false](src/main/AndroidManifest.xml). WARNING Your application can override the allow backup, just be sure that there is no sensitive data or secrets that might be backed up. Option can be used with  `tools:replace=\"android:allowBackup\"`\n\n#### Kotlin\n```kotlin\n// MainActivity.kt\n\nimport org.libsodium.jni.SodiumConstants\nimport org.libsodium.jni.crypto.Random\nimport org.libsodium.jni.keys.KeyPair\n\nclass MainActivity : AppCompatActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n\n        // Test Libsodium\n        val seed = Random().randomBytes(SodiumConstants.SECRETKEY_BYTES)\n        val encryptionKeyPair = KeyPair(seed)\n        Log.i(\"PUBLIC KEY:\", encryptionKeyPair.publicKey.toString())\n    }\n}\n\n```\n\n## Manual Compilation and Installation\n\n### MacOS Manual Compilation and Installation\n\nInstall brew\n\nRun [./dependencies-mac.sh](dependencies-mac.sh)\n\nRun [./build-mac.sh](build-mac.sh)\n\n### Linux Manual Compilation and Installation\n\nRun [./dependencies-linux.sh](dependencies-linux.sh)\n\nRun [./build-linux.sh](build-linux.sh)\n\n## Docker Container\n\nThe docker container is available from [libsodium-jni](https://hub.docker.com/r/joshjdevl/libsodium-jni/) which is a Automated Build.\n\n### Manual compilation and installation\n\nPlease refer to the [docker build](https://github.com/joshjdevl/libsodium-jni/blob/master/Dockerfile) for the commands used to build.\n\n### Notes\n\n[Docker container](https://hub.docker.com/r/joshjdevl/libsodium-jni/)\n\n## Vagrant\n\nA [Vagrantfile](Vagrantfile) is available for those that would like to set up a virtual machine.\n\n\n## Example application\nClone the repo and import project from folder example/Sodium in Android studio (Android studio 2.1). Android studio will handle the rest.\nCompile and run. Tested to emulators down to Android Version 16.\n\n## Manual AAR usage\nTo use the AAR project as is (No .SO file imports needed).\n\nIt is also possible to build the AAR library yourself using the provided scripts [linux](build-linux.sh) or [mac](build-mac.sh). After building the library open module settings and add the libsodium-jni-release.aar and/or libsodium-jni-debug.aar as a dependency.\n\n### Custom code usage\nTo use the library with your own custom code, skip the aar file and add\n\n1. The native .SO libraries in your project (Create jnilibs folder and make the required changes to the gradle file)\n2. Add the source code from the src folder and add your own additional code.\n\n\n### Issues / Improvements / Help Seeked :v:\n\n*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.\n\n`gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 4524D716`\n\n### SWIG Extensions\n\nSWIG is used to generate the Java JNI bindings. This means that the same interface definition can be used to generate bindings for all languages supported by SWIG. The interface can be found [here](jni/sodium.i)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjdevl%2Flibsodium-jni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshjdevl%2Flibsodium-jni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjdevl%2Flibsodium-jni/lists"}