{"id":13733314,"url":"https://github.com/phxql/argon2-jvm","last_synced_at":"2026-04-09T18:39:34.873Z","repository":{"id":3394240,"uuid":"49338319","full_name":"phxql/argon2-jvm","owner":"phxql","description":"Argon2 Binding for the JVM","archived":false,"fork":false,"pushed_at":"2025-03-05T10:50:34.000Z","size":4587,"stargazers_count":335,"open_issues_count":4,"forks_count":33,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-11T22:26:39.704Z","etag":null,"topics":["argon2","hacktoberfest","hashing","java","jvm","password"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phxql.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-01-09T19:32:58.000Z","updated_at":"2025-04-11T01:21:09.000Z","dependencies_parsed_at":"2025-04-11T20:38:28.665Z","dependency_job_id":"6653bd78-6305-4bc6-a4d6-c2bf71944c8c","html_url":"https://github.com/phxql/argon2-jvm","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fargon2-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fargon2-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fargon2-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phxql%2Fargon2-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phxql","download_url":"https://codeload.github.com/phxql/argon2-jvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319716,"owners_count":22051072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argon2","hacktoberfest","hashing","java","jvm","password"],"created_at":"2024-08-03T03:00:41.113Z","updated_at":"2026-04-09T18:39:34.800Z","avatar_url":"https://github.com/phxql.png","language":"Java","funding_links":[],"categories":["Libraries","安全"],"sub_categories":["Java"],"readme":"# Argon2 Binding for the JVM ![Build \u0026 test](https://github.com/phxql/argon2-jvm/workflows/Build%20\u0026%20test/badge.svg)\n\nThis is a JVM binding for [Argon2](https://github.com/P-H-C/phc-winner-argon2).\n\n\"Being a binding\" means that it uses JNA to call a native C library. The advantage of this approach is that this uses the original implementation of the Argon2 authors and possibly a performance advantage. The drawback is that the native library must either be available on your system or must be included in argon2-jvm.\n\nIf you are using an OS or an architecture which is not that common (e.g. argon2-jvm has no support for BSD), this library will not work for you, if your system has no native installation of the Argon2 library.\n\n[Spring Security Crypto](https://github.com/spring-projects/spring-security/tree/master/crypto) has a `Argon2PasswordEncoder`\nwhich doesn't have any dependencies on native C libraries, as it uses Bouncy Castle which implements the Argon2 algorithm in pure Java. And don't let the name \"Spring Security Crypto\" scare you, it has no dependency on Spring or Spring Security. If you don't need (for whatever reason) the native Argon2 library, I would suggest that you look at the `Argon2PasswordEncoder` from Spring Security Crypto.\n\nI have prepared a [small showcase project](https://github.com/phxql/argon2-playground) which demonstrates the use of Argon2 with Spring Security Crypto.\n\n## Maven\n\nWithout pre-compiled Argon2 libraries (recommended, install argon2 via your package manager):\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.mkammerer\u003c/groupId\u003e\n    \u003cartifactId\u003eargon2-jvm-nolibs\u003c/artifactId\u003e\n    \u003cversion\u003e2.12\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nWith pre-compiled Argon2 libraries:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.mkammerer\u003c/groupId\u003e\n    \u003cartifactId\u003eargon2-jvm\u003c/artifactId\u003e\n    \u003cversion\u003e2.12\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Gradle\n\nWithout pre-compiled Argon2 libraries (recommended, install argon2 via your package manager):\n\n```groovy\nimplementation 'de.mkammerer:argon2-jvm-nolibs:2.12'\n```\n\nWith pre-compiled Argon2 libraries:\n\n```groovy\nimplementation 'de.mkammerer:argon2-jvm:2.12'\n```\n\n## Usage\n\nThis 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`:\n\n* Linux x86\n* Linux x86-64\n* Linux ARM\n* Linux ARM-64\n* Windows x86\n* Windows x86-64\n* Darwin (OSX)\n* Darwin (OSX) M1\n\nSee [tested distributions](compatibility-tests/README.md) for details on which distributions this has been tested.\n\n```java\nimport de.mkammerer.argon2.Argon2;\nimport de.mkammerer.argon2.Argon2Factory;\n\n// Create instance\nArgon2 argon2 = Argon2Factory.create();\n\n// Read password from user\nchar[] password = readPasswordFromUser();\n\ntry {\n    // Hash password\n    String hash = argon2.hash(10, 65536, 1, password);\n\n    // Verify password\n    if (argon2.verify(hash, password)) {\n        // Hash matches password\n    } else {\n        // Hash doesn't match password\n    }\n} finally {\n    // Wipe confidential data\n    argon2.wipeArray(password);\n}\n```\n\n## Recommended parameters\n\nThe recommended parameters for the `hash` call above can be found in the [whitepaper](https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf), section 9.\n\nYou can use the method `Argon2Helper.findIterations` to find the optimal number of iterations on your system:\n\n```java\nArgon2 argon2 = Argon2Factory.create();\n// 1000 = The hash call must take at most 1000 ms\n// 65536 = Memory cost\n// 1 = parallelism\nint iterations = Argon2Helper.findIterations(argon2, 1000, 65536, 1);\n\nSystem.out.println(\"Optimal number of iterations: \" + iterations);\n```\n\n## Compile Argon2 yourself\n\nIf 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 :)\n\nIf you need help to build argon2, have a look at [this documentation](docs/compile-argon2.md).\n\n## Technical details\n\nThis library uses [JNA](https://github.com/java-native-access/jna) to communicate with the Argon2 C library.\n\n## Building it yourself\n\nRun `./gradlew clean build` to build and test the software.\n\n## License\n\nLicensed under [LGPL v3](https://www.gnu.org/licenses/lgpl.html).\n\n## Maintainer\n\nMoritz Halbritter ([@phXql](https://github.com/phxql))\n\n## Contributing\n\nSee [contributing guidelines](CONTRIBUTING.md).\n\n## Contributors\n\nSee [contributors page](https://github.com/phxql/argon2-jvm/graphs/contributors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphxql%2Fargon2-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphxql%2Fargon2-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphxql%2Fargon2-jvm/lists"}