Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.04 KB

README.md

File metadata and controls

49 lines (38 loc) · 1.04 KB

Argon2 Library

Wrapper around the reference C implementation of Argon2.

Android Usage

implementation 'org.signal:argon2:13.1@aar'
Argon2 argon2 = new Argon2.Builder(Version.V13)
                          .type(Type.Argon2id)
                          .memoryCost(MemoryCost.MiB(32))
                          .parallelism(1)
                          .iterations(3)
                          .build();
                          
                          
Argon2.Result result = argon2.hash(password, salt);

byte[] hash    = result.getHash();
String hashHex = result.getHashHex();
String encoded = result.getEncoded();

iOS Usage

Add the following line to your Podfile:

pod 'Argon2', git: 'https://github.com/signalapp/Argon2.git', submodules: true
let (rawHash, encodedHash) = Argon2.hash(
    iterations: 1,
    memoryInKiB: 32 * 1024,
    threads: 1,
    password: password,
    salt: salt,
    desiredLength: 32,
    variant: .id,
    version: .v13
)