Skip to content
/ Lyra2 Public

Lyra2 password hashing algorithm implementation in Java

Notifications You must be signed in to change notification settings

kozlm/Lyra2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lyra2 algorithm implementation in Java

Implementation of the Lyra2 password hashing algorithm on a single thread in Java. One of the goals of this project was to follow OOP good practices, while not making the code too complicated.

More information about Lyra2 and the official Lyra2 documentation.

Features

  • Sponge Algorithms: Supports both BlaMka and Blake2B as sponge functions.
  • Configurable Parameters: Allows customization of the memory matrix size, number of rounds, block size, and more to tailor the hashing process to your needs.
  • High Security

Usage

  1. Clone the repository and go to the project directory:
git clone https://github.com/kozlm/Lyra2.git
cd Lyra2
  1. Compile the project:
mvn package
  1. Use the following syntax to hash your password:
java -jar ./target/Lyra2-1.0-SNAPSHOT.jar [options] [password to hash]
  • For more information about the syntax use:
    java -jar ./target/Lyra2-1.0-SNAPSHOT.jar --help

Required Options

  • -a, --algorithm: Sponge algorithm to use.
    Possible values: BlaMka, Blake2B.

  • -k, --hashlength: The length of the hashed password in bytes.

  • -s, --salt: The salt to use during hashing.

Optional Parameters

  • -b, --blocks: The number of longs (8 bytes) that make up a block in the memory matrix.
    Default: 12
    Range: [1 - 12]

  • -c, --cols: The number of columns in the memory matrix.
    Default: 256

  • -f, --fullrounds: The number of rounds performed by the regular sponge function.
    Default: 12
    Range: [1 - 12]

  • -h, --halfrounds: The number of rounds performed by the reduced sponge function.
    Default: 6
    Range: [1 - 12]

  • -r, --rows: The number of rows in the memory matrix.
    Default: 10

  • -t, --timecost: The time cost parameter, which adjusts the execution time of the algorithm.
    Default: 10

Example

Here is an example of how to use the Lyra2 algorithm with specific options:

java -jar ./target/Lyra2-1.0-SNAPSHOT.jar -a Blake2B -s ssss -k 1 -f 12 -h 12 -b 12 -c 256 -r 3 -t 100 'password123'

References

During the development of this project, the following Git repositories were used as conceptual references:

About

Lyra2 password hashing algorithm implementation in Java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages