Why should I use Lazysodium?

We get it. You've tried a million other cryptography libraries and you're tired of performing mental gymnastics just to get something, anything working. We've done the work for you. We've compiled and wrapped the native libraries inside this project so you don't have to. We've designed our library in such a way that just makes cryptography infinitely easier to work with and deploy in a matter of minutes.

Under the hood, we're using Libsodium, an excellent audited cryptography library that just works. We've implemented all the features of Libsodium in Lazysodium. To find out more about why we created Lazysodium visit the about page.

Why is this project called Lazysodium?

We wanted developers to have an effortless experience using cryptography. Every cryptography library we came across for Java and Android was plagued with inconsistencies and outdatedness. We thought, "Someone should do something about this...". So we did.

Why create both Lazysodium for Java and Lazysodium for Android? Aren't they the same?

Even though you can code in Java on Android, it does not mean that Android conforms to Java's semantics surrounding the build and packaging phases. For example, Java packages files as a jar and Android packages files as an aar. This is so that you can include res files in your Android projects. This is why we have both Lazysodium for Android and Lazysodium for Java even if the former is just a wrapper around the latter.

Why are some functions unavailable on Android?

The reason why some functions are not included in Android, is because we have compiled Libsodium against "minimal mode" which means that more demanding functions won't run on low powered hardware. If you really want to use those functions recompile Libsodium in "full mode" and then self provision it.

What platforms does Lazysodium support?

Please see this page for more information.

Does Lazysodium have example apps?

Yes! Please download it from the Google Play Store.

Lazysodium contains a bug

We're sorry to hear this. It goes against our ethos to make you do some work, but if you could create an issue on the issue tracker https://github.com/terl/lazysodium-java/issues, that'd be perfect.

Every time I use Lazysodium I get an error like java.lang.UnsatisfiedLinkError: Unable to load library. What is this?

This can occur for a number of reasons. Most commonly the error occurs when we try to load libsodium.so / libsodium.dll / libsodium.dylib - Lazysodium can't find it. Or, the error may occur for a totally different reason: The native Libsodium library (i.e. the libsodium.so / libsodium.dll / libsodium.dylib files) requests access to C functions which your OS does not have and so it results in a UnsatsifiedLinkError. Confusing, huh? There's more info in this issue.

I get the Failed resolution of: Lcom/sun/jna/Native error, how do I resolve it?

This error occurs if you don't include JNA as a dependency in your project. Please add the following line in your project:

dependencies {
implementation 'net.java.dev.jna:jna:[email protected]' // Add this line
dependencies {
implementation 'net.java.dev.jna:jna:LATEST_VERSION' // Add this line

Where LATEST_VERSION is the latest version of JNA.

How do I verify a file through GPG?

Our Ed25519 GPG Public Key is:

Comment: GPGTools - https://gpgtools.org

You can verify that a file was from us by performing the command:

# The general format is gpg --verify signature signedFile, for example:
$ gpg --verify lazysodium-java-2.3.0.jar.asc lazysodium-java-2.3.0.jar

Which should output:

gpg: Signature made Tue 5 Jun 01:33:36 2018 BST
gpg: using EDDSA key D1A9234F12141C2808B3E6015FCBE4222D2C66D7
gpg: Good signature from "Terl Tech Ltd <[email protected]>" [ultimate]

Do you have any apps to showcase Lazysodium?

As a matter of fact, we do! Visit Google Play to see some of what Lazysodium can do.

Download Lazysodium