{"id":18494966,"url":"https://github.com/qaware/heimdall","last_synced_at":"2025-04-08T22:31:40.983Z","repository":{"id":34337346,"uuid":"38257704","full_name":"qaware/heimdall","owner":"qaware","description":"Secure Password Storage","archived":false,"fork":false,"pushed_at":"2023-05-02T04:36:22.000Z","size":228,"stargazers_count":37,"open_issues_count":1,"forks_count":4,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-03-23T19:11:14.253Z","etag":null,"topics":["algorithm","hash","heimdall","pbkdf2","security"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qaware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-29T16:20:58.000Z","updated_at":"2023-05-02T04:35:52.000Z","dependencies_parsed_at":"2022-09-26T22:01:37.065Z","dependency_job_id":null,"html_url":"https://github.com/qaware/heimdall","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fheimdall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fheimdall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fheimdall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fheimdall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qaware","download_url":"https://codeload.github.com/qaware/heimdall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247940396,"owners_count":21021958,"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":["algorithm","hash","heimdall","pbkdf2","security"],"created_at":"2024-11-06T13:22:56.716Z","updated_at":"2025-04-08T22:31:38.100Z","avatar_url":"https://github.com/qaware.png","language":"Java","readme":"![Heimdall Logo](/logos/Heimdall_combined_medium.png)\n\n# Heimdall - Secure Password Hashing\n\n[![Build Status](https://travis-ci.org/qaware/heimdall.svg?branch=master)](https://travis-ci.org/qaware/heimdall) [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)]() [![Download](https://api.bintray.com/packages/qaware-oss/maven/heimdall/images/download.svg)](https://bintray.com/qaware-oss/maven/heimdall/_latestVersion)\n\nThis library implements a secure and upgradeable password hashing mechanism. See [this blog post](http://qaware.blogspot.de/2015/03/secure-password-storage-and.html) for details.\n\n## Why not just use PBKDF2, scrypt, bcrypt, etc.?\n\nActually, this library uses (some of) these algorithms. But it makes it easier for you: no need to worry about iterations, salt\ngeneration and the same. And if a flaw is discovered in one of the algorithms, the library makes sure that the hashes\nin your database are automatically updated to a secure format (provided you use the pattern as shown in the usage block\ndown below).\n\n## Usage\n\n### Dependencies\n\nThe JARs are available via JCenter and Maven Central. If you are using Maven to build your project, add the following to the `pom.xml` file:\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ede.qaware.heimdall\u003c/groupId\u003e\n        \u003cartifactId\u003eheimdall\u003c/artifactId\u003e\n        \u003cversion\u003e$LATEST_VERSION\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nIn case you are using Gradle to build your project, add the following to the `build.gradle` file:\n```groovy\nrepositories {\n    jcenter()    \n    mavenCentral()\n}\n\ndependencies {\n\tcompile 'de.qaware.heimdall:heimdall:$LATEST_VERSION'\n}\n```\n\nReplace `$LATEST_VERSION` with the version from this badge:\n \n[![Download](https://api.bintray.com/packages/qaware-oss/maven/heimdall/images/download.svg)](https://bintray.com/qaware-oss/maven/heimdall/_latestVersion)\n\n### Create a hash\n```java\nPassword password = PasswordFactory.create();\n\ntry(SecureCharArray cleartext = new SecureCharArray(...)) { // Read cleartext password from user\n    String hash = password.hash(cleartext);\n    // Persist the hash in a database etc...\n}\n```\n\n### Verify the hash\n```java\nPassword password = PasswordFactory.create();\n\nString hash = ... // Load hash from persistent storage\ntry(SecureCharArray cleartext = new SecureCharArray(...)) { // Read cleartext password from user\n    if (password.verify(cleartext, hash)) {\n        if (password.needsRehash(hash)) { // Check if the hash uses an old hash algorithm, insecure parameters, etc.\n            String newHash = password.hash(cleartext);\n            // Persist the new hash in a database etc...\n        }\n\n        // Password is correct, proceed...\n    } else {\n        // Password is incorrect\n    }\n}\n```\n\n\n## Changes\n\nLooking for a [change log](CHANGES.md)?\n\n## Technical details\n\nBy default this library uses the PBKDF2 SHA-1 HMAC (`PBKDF2WithHmacSHA1`) with 20000 iterations and 192 bit (24 byte) of salt.\n\n## Useful resources\n\n* Heimdall integration in Spring Security: https://gist.github.com/clboettcher/663bf04cf24ffb0e6e0791b32ee1dc7c\n\n## Maintainer\n\nMoritz Kammerer (@phxql), \u003cmoritz.kammerer@qaware.de\u003e\n\n## Contributors\n\nSee [the list of contributors](https://github.com/qaware/heimdall/graphs/contributors).\n\n## License\n\nThis software is provided under the MIT open source license, read the `LICENSE.txt` file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaware%2Fheimdall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqaware%2Fheimdall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaware%2Fheimdall/lists"}