Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kozlm/lyra2
Lyra2 password hashing algorithm implementation in Java
https://github.com/kozlm/lyra2
cryptography java junit lyra2 maven password-hashing phs
Last synced: about 7 hours ago
JSON representation
Lyra2 password hashing algorithm implementation in Java
- Host: GitHub
- URL: https://github.com/kozlm/lyra2
- Owner: kozlm
- Created: 2024-02-24T23:45:06.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-09-09T11:52:21.000Z (2 months ago)
- Last Synced: 2024-09-09T14:06:08.220Z (2 months ago)
- Topics: cryptography, java, junit, lyra2, maven, password-hashing, phs
- Language: Java
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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][2] and the official [Lyra2 documentation][1].
## 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:
```bash
git clone https://github.com/kozlm/Lyra2.git
cd Lyra2
```
2. Compile the project:
```bash
mvn package
```
3. Use the following syntax to hash your password:
```bash
java -jar ./target/Lyra2-1.0-SNAPSHOT.jar [options] [password to hash]
```
- For more information about the syntax use:
```bash
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:
```bash
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:
- **[Original implementation][4]** used for planning of the project outline
- **[Lyra2 Java Implementation][3]** by Alexander Lisianoi used for testing and debugging
[1]: https://eprint.iacr.org/2015/136
[2]: https://en.wikipedia.org/wiki/Lyra2
[3]: https://github.com/alisianoi/lyra2-java
[4]: https://github.com/leocalm/Lyra