Git Product home page Git Product logo

argon2-jvm's Introduction

Argon2 Binding for the JVM Build Status

This is a JVM binding for Argon2.

Maven

With pre-compiled Argon2 libraries:

<dependency>
    <groupId>de.mkammerer</groupId>
    <artifactId>argon2-jvm</artifactId>
    <version>2.3</version>
</dependency>

Without pre-compiled Argon2 libraries:

<dependency>
    <groupId>de.mkammerer</groupId>
    <artifactId>argon2-jvm-nolibs</artifactId>
    <version>2.3</version>
</dependency>

Gradle

With pre-compiled Argon2 libraries:

compile 'de.mkammerer:argon2-jvm:2.3'

Without pre-compiled Argon2 libraries:

compile 'de.mkammerer:argon2-jvm-nolibs:2.3'

Usage

This binding needs the Argon2 C library. Libraries for the following operation systems are included in argon2-jvm library:

  • Linux x86
  • Linux x86-64
  • Windows x86
  • Windows x86-64
  • Darwin (OSX)

If you'd prefer to install/compile argon2 on your own you can use argon2-jvm-nolibs instead of argon2-jvm.

If you need help to build argon2, have a look at this documentation.

// Create instance
Argon2 argon2 = Argon2Factory.create();

// Read password from user
char[] password = readPasswordFromUser();

try {
    // Hash password
    String hash = argon2.hash(2, 65536, 1, password);

    // Verify password
    if (argon2.verify(hash, password)) {
        // Hash matches password
    } else {
        // Hash doesn't match password
    }
} finally {
    // Wipe confidential data
    argon2.wipeArray(password);
}

Technical details

This library uses JNA to communicate with the Argon2 C library.

Building it yourself

Run ./gradlew clean build to build and test the software.

License

LGPL v3

Maintainer

Moritz Kammerer (@phXql)

Contributing

See contributing.md

Contributor

See contributor.md

argon2-jvm's People

Contributors

llowrey avatar naude-r avatar phxql avatar tamaspolgar avatar zblach avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.