All Projects → phxql → Argon2 Jvm

phxql / Argon2 Jvm

Licence: lgpl-3.0
Argon2 Binding for the JVM

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Argon2 Jvm

Password4j
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.
Stars: ✭ 124 (-49.39%)
Mutual labels:  hashing, jvm, password, argon2
Node Argon2
Node.js bindings for Argon2 hashing algorithm
Stars: ✭ 1,008 (+311.43%)
Mutual labels:  hashing, password, argon2
secrets.clj
A library designed to generate cryptographically strong random numbers.
Stars: ✭ 64 (-73.88%)
Mutual labels:  jvm, password
CryptoKnight
CryptoKnight is a general purpose cryptography desktop app
Stars: ✭ 18 (-92.65%)
Mutual labels:  hashing, password
crypthash-net
CryptHash.NET is a .NET multi-target library to encrypt/decrypt/hash/encode/decode strings and files, with an optional .NET Core multiplatform console utility.
Stars: ✭ 33 (-86.53%)
Mutual labels:  argon2, password
Upash
🔒Unified API for password hashing algorithms
Stars: ✭ 484 (+97.55%)
Mutual labels:  hashing, password
password-hasher
The PasswordHasher component provides password hashing utilities.
Stars: ✭ 425 (+73.47%)
Mutual labels:  hashing, password
Argon2 Cffi
Secure Password Hashes for Python
Stars: ✭ 264 (+7.76%)
Mutual labels:  password, argon2
Unchained
Secure password hashers for Go compatible with Django
Stars: ✭ 46 (-81.22%)
Mutual labels:  password, argon2
Lazysodium Android
An Android implementation of the Libsodium cryptography library. For the lazy dev.
Stars: ✭ 69 (-71.84%)
Mutual labels:  hashing, argon2
Two Factor Auth
Two Factor Authentication Java code implementing the Time-based One-time Password Algorithm
Stars: ✭ 225 (-8.16%)
Mutual labels:  password
Cli Prompt
Allows you to prompt for user input on the command line, and optionally hide the characters they type
Stars: ✭ 228 (-6.94%)
Mutual labels:  password
My Review
主要存放平时理论学习,比如java jdk源码分析、并发理论;面试、数据库、Linux、中间件、分布式、网络协议等方向
Stars: ✭ 237 (-3.27%)
Mutual labels:  jvm
Openj9
Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Stars: ✭ 2,802 (+1043.67%)
Mutual labels:  jvm
Password Validator
Validates password according to flexible and intuitive specification
Stars: ✭ 224 (-8.57%)
Mutual labels:  password
Oblivion
Data leak checker & OSINT Tool
Stars: ✭ 237 (-3.27%)
Mutual labels:  password
Passport Local
Username and password authentication strategy for Passport and Node.js.
Stars: ✭ 2,545 (+938.78%)
Mutual labels:  password
Future
High-performance Future implementation for the JVM
Stars: ✭ 223 (-8.98%)
Mutual labels:  jvm
Eta
The Eta Programming Language, a dialect of Haskell on the JVM
Stars: ✭ 2,507 (+923.27%)
Mutual labels:  jvm
Diceware
Passphrases to remember
Stars: ✭ 242 (-1.22%)
Mutual labels:  password

Argon2 Binding for the JVM Build & test

This is a JVM binding for Argon2.

Maven

Without pre-compiled Argon2 libraries (recommended, install argon2 via your package manager):

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

With pre-compiled Argon2 libraries:

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

Gradle

Without pre-compiled Argon2 libraries (recommended, install argon2 via your package manager):

implementation 'de.mkammerer:argon2-jvm-nolibs:2.9.1'

With pre-compiled Argon2 libraries:

implementation 'de.mkammerer:argon2-jvm:2.9.1'

Usage

This binding needs a compiled Argon2 library. It is recommended to install argon2 via your package manager. If you can't do that, use argon2-jvm with the included argon2 binary libraries or compile argon2 yourself. The following operating systems and architectures are supported in argon2-jvm:

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

See tested distributions for details on which distributions this has been tested.

import de.mkammerer.argon2.Argon2;
import de.mkammerer.argon2.Argon2Factory;

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

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

try {
    // Hash password
    String hash = argon2.hash(10, 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);
}

Recommended parameters

The recommended parameters for the hash call above can be found in the whitepaper, section 9.

You can use the method Argon2Helper.findIterations to find the optimal number of iterations on your system:

Argon2 argon2=Argon2Factory.create();
// 1000 = The hash call must take at most 1000 ms
// 65536 = Memory cost
// 1 = parallelism
        int iterations=Argon2Helper.findIterations(argon2,1000,65536,1);

        System.out.println("Optimal number of iterations: "+iterations);

Compile Argon2 yourself

If you prefer to install/compile argon2 on your own you should argon2-jvm-nolibs instead of argon2-jvm and compile argon2 yourself. It's not that hard :)

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

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

Licensed under LGPL v3.

Maintainer

Moritz Kammerer (@phXql)

Contributing

See contributing guidelines.

Contributors

See contributors page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].