Skip to content
Gurpreet Paul edited this page May 16, 2018 · 6 revisions

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. Plus, we've designed our library in such a way that just makes it infinitely easier to work with.

For example, this:

byte[] subkey = subkey[32];
int subkeyLen = subkey.length;
long subkeyId = 1L;
byte[] context = "Examples".getBytes(StandardCharsets.UTF_8);
byte[] masterKey = "a_master_key".getBytes(StandardCharsets.UTF_8);
int result = lazySodium.cryptoKdfDeriveFromKey(subkey, subkeyLen, subkeyId, context, masterKey);

// Now check the result
if (res == 0) {
    // We have a positive result. Let's store it in a database.
    String subkeyString = new String(subkey, StandardCharsets.UTF_8);
}

...becomes this:

long subKeyId = 1L;
String context = "Examples";
String masterKey = "a_master_key";
String subkeyString = lazySodium.cryptoKdfDeriveFromKey(subKeyId, context, masterKey);

💯 💯

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.

Where is crypto_shorthash_siphashx24()?

This function was removed in version 1.0.3 as Android complained that it was not found in libsodium.so. It worked in Java so it was purely an Android specific error. See issue 15.

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, that'd be perfect.

Clone this wiki locally