/lazysodium-java

A Java implementation of the Libsodium crypto library. For the lazy dev.

Primary LanguageJavaMozilla Public License 2.0MPL-2.0

Lazysodium for Java

Lazysodium is a complete Java (JNA) wrapper over the Libsodium library that provides developers with a smooth and effortless cryptography experience.

Build Status Download

Help us grow

Lazysodium needs your support for it to continue being maintained and improved. Even if you put forward £1/$1/€1 it still means a lot for us. Your money would go into improving our open-source projects first and foremost. If you want to find out more, use your preffered donation platform.

Patreon only has recurring donations and rewards. Liberapay has one-off donations and recurring donations but does not have rewards.



Why Lazysodium

We created Lazysodium because we really wanted a solid cryptography library that would just work without fuss.

We were exasperated and annoyed with current Libsodium implementations as some of them were just poorly maintained, poorly managed and, plain and simply, poorly architected.

Thus, Lazysodium was born with the blessings of Lazycode, a part of Terl that specialises in giving developers easy-to-use software and tools that just work. Read more about us below.

Using the native functions

byte[] subkey = subkey[32];
byte[] context = "Examples".getBytes(StandardCharsets.UTF_8);
byte[] masterKey = "a_master_key".getBytes(StandardCharsets.UTF_8);
int result = lazySodium.cryptoKdfDeriveFromKey(subkey, subkey.length, 1L, 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);
}

Or use Lazysodium's lazy functions

You could use the above native functions or you could use the "Lazy" functions 😄

String context = "Examples";
String masterKey = "a_master_key";
String subkeyString = lazySodium.cryptoKdfDeriveFromKey(1L, context, masterKey);
// Now store in database or something

As you can see Lazysodium's lazy functions save you a lot of pain!


Installation, documentation, FAQ and everything else

See our official documentation to get started.



Created by the wizards at Terl.