{"id":17498374,"url":"https://github.com/simonepri/pbkdf2-crypt","last_synced_at":"2026-05-02T14:32:10.647Z","repository":{"id":57321166,"uuid":"123704724","full_name":"simonepri/pbkdf2-crypt","owner":"simonepri","description":"🔒 Cryptographically secure password hashing algorithm based on pbkdf2 key derivation function. ","archived":false,"fork":false,"pushed_at":"2018-03-29T19:23:19.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T11:15:01.828Z","etag":null,"topics":["hashing-algorithm","hashing-passwords","nodejs","password","password-hash","pbkdf2","pbkdf2-crypt","secure"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/simonepri.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"license","code_of_conduct":".github/code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-03T15:32:21.000Z","updated_at":"2018-03-29T19:44:32.000Z","dependencies_parsed_at":"2022-08-26T01:11:10.643Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/pbkdf2-crypt","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fpbkdf2-crypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fpbkdf2-crypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fpbkdf2-crypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fpbkdf2-crypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/pbkdf2-crypt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246216536,"owners_count":20742003,"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":["hashing-algorithm","hashing-passwords","nodejs","password","password-hash","pbkdf2","pbkdf2-crypt","secure"],"created_at":"2024-10-19T16:53:44.641Z","updated_at":"2026-05-02T14:32:10.607Z","avatar_url":"https://github.com/simonepri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cb\u003epbkdf2-crypt\u003c/b\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003c!-- CI - TravisCI --\u003e\n  \u003ca href=\"https://travis-ci.org/simonepri/pbkdf2-crypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/simonepri/pbkdf2-crypt/master.svg?label=MacOS%20%26%20Linux\" alt=\"Mac/Linux Build Status\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- CI - AppVeyor --\u003e\n  \u003ca href=\"https://ci.appveyor.com/project/simonepri/pbkdf2-crypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/appveyor/ci/simonepri/pbkdf2-crypt/master.svg?label=Windows\" alt=\"Windows Build status\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Coverage - Codecov --\u003e\n  \u003ca href=\"https://codecov.io/gh/simonepri/pbkdf2-crypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/codecov/c/github/simonepri/pbkdf2-crypt/master.svg\" alt=\"Codecov Coverage report\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- DM - Snyk --\u003e\n  \u003ca href=\"https://snyk.io/test/github/simonepri/pbkdf2-crypt?targetFile=package.json\"\u003e\n    \u003cimg src=\"https://snyk.io/test/github/simonepri/pbkdf2-crypt/badge.svg?targetFile=package.json\" alt=\"Known Vulnerabilities\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- DM - David --\u003e\n  \u003ca href=\"https://david-dm.org/simonepri/pbkdf2-crypt\"\u003e\n    \u003cimg src=\"https://david-dm.org/simonepri/pbkdf2-crypt/status.svg\" alt=\"Dependency Status\" /\u003e\n  \u003c/a\u003e\n\n  \u003cbr/\u003e\n\n  \u003c!-- Code Style - XO-Prettier --\u003e\n  \u003ca href=\"https://github.com/xojs/xo\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code_style-XO+Prettier-5ed9c7.svg\" alt=\"XO Code Style used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Test Runner - AVA --\u003e\n  \u003ca href=\"https://github.com/avajs/ava\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/test_runner-AVA-fb3170.svg\" alt=\"AVA Test Runner used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Test Coverage - Istanbul --\u003e\n  \u003ca href=\"https://github.com/istanbuljs/nyc\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/test_coverage-NYC-fec606.svg\" alt=\"Istanbul Test Coverage used\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Release System - np --\u003e\n  \u003ca href=\"https://github.com/sindresorhus/np\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/release_system-np-6c8784.svg\" alt=\"NP Release System used\" /\u003e\n  \u003c/a\u003e\n\n  \u003cbr/\u003e\n\n  \u003c!-- Version - npm --\u003e\n  \u003ca href=\"https://www.npmjs.com/package/pbkdf2-crypt\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/pbkdf2-crypt.svg\" alt=\"Latest version on npm\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- License - MIT --\u003e\n  \u003ca href=\"https://github.com/simonepri/pbkdf2-crypt#license\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/simonepri/pbkdf2-crypt.svg\" alt=\"Project license\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  🔒 Cryptographically secure password hashing algorithm based on pbkdf2 key derivation function.\n\n  \u003cbr/\u003e\n\n  \u003csub\u003e\n    Coded with ❤️ by \u003ca href=\"#authors\"\u003eSimone Primarosa\u003c/a\u003e.\n  \u003c/sub\u003e\n\u003c/p\u003e\n\n\u003chr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eDEPRECATED!!! USE \u003ca href=\"https://github.com/simonepri/phc-pbkdf2\"\u003e@phc/pbkdf2\n\u003c/a\u003e INSTEAD\u003c/strong\u003e\n\u003c/p\u003e\n\u003chr/\u003e\n\n## Install\n\n```bash\nnpm install --save pbkdf2-crypt\n```\n\n## Usage\n```js\nconst pbkdf2c = require('pbkdf2-crypt');\n\n// Hash and verify with pbkdf2 and default configs\npbkdf2c.hash('We are all unicorns')\n  .then(hash) =\u003e {\n\n    console.log(hash);\n    //=\u003e \"mOyc16tOzjyRlVwE0UknfYLkWhboVaepNDSlpXGsgVIjmV3ATpMgbUkvtAQVuGWYX8499ta+qTSwMS5mShHrPEMR1w/JRa3TiOYRK6D7K7Q0JhFkp83suUKaO2qqXf7XXlbeEQjEHyxXOQejKBxhbl7vdlgQcUnsovCtEhOesD0=,B1izIvz3r4CKWswSeWh11ClEVrXxs/2jDD0LGSUMar/KQyBI6x4CfkcnsC4WHU29Meew8aQYyURwS8tjP7N+tMM1NhM1FDnWH0766noazbVd1rNG8IHoroD8v0jQcHYTRth2pviQaoJszKcLP43XT+c9DNYolDXzeKQAPZ3+mI0=,10000,128,sha512\"\n\n    pbkdf2c.verify(hash, 'We are all unicorns')\n      .then(match) =\u003e {\n        console.log(match);\n        //=\u003e true\n      });\n\n  });\n\n// Hash and verify with pbkdf2 and custom configs\npbkdf2c.hash('We are all unicorns', {digest: 'sha1', iterations: 15000})\n  .then(hash) =\u003e {\n\n    console.log(hash);\n    //=\u003e \"suaEhih1LNHXbcWMc7lzdY7z0F3bVbVvuIGr7kAMCPNQ9vGsIhQWL//GIdZ4NNLs8n7rNkRFYHzEqBjl+GgzSQ==,T82zIg2ej8IOYBqqlGOtduKVFUUMras1eJ1U1khGTfeP1caP3jAozGQqS149Pynq9PlEGP0hhMOsywrKj97VUw==,7500,64,sha1\"\n\n    pbkdf2c.verify(hash, 'We are all unicorns')\n      .then(match) =\u003e {\n        console.log(match);\n        //=\u003e true\n      });\n\n  });\n```\n\n## API\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#hash\"\u003ehash(password, [options])\u003c/a\u003e ⇒ \u003ccode\u003ePromise.\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eComputes the secure hash string of the given password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003ca href=\"#verify\"\u003everify(hash, input)\u003c/a\u003e ⇒ \u003ccode\u003ePromise.\u0026lt;boolean\u0026gt;\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eDetermines whether or not the user\u0026#39;s input matches the secure hashed password.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"hash\"\u003e\u003c/a\u003e\n\n## hash(password, [options]) ⇒ \u003ccode\u003ePromise.\u0026lt;string\u0026gt;\u003c/code\u003e\nComputes the secure hash string of the given password.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003ePromise.\u0026lt;string\u0026gt;\u003c/code\u003e - The generated secure hash string.  \n**Access**: public  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| password | \u003ccode\u003estring\u003c/code\u003e | The password to hash. |\n| [options] | \u003ccode\u003eObject\u003c/code\u003e | Configurations related to the hashing function. |\n| [options.iterations] | \u003ccode\u003enumber\u003c/code\u003e | The number of iterations to compute the derived key. |\n| [options.keylen] | \u003ccode\u003enumber\u003c/code\u003e | Length of the computed derived key. |\n| [options.digest] | \u003ccode\u003enumber\u003c/code\u003e | A digest function from the crypto.getHashes() list of supported digest functions. |\n\n\u003ca name=\"verify\"\u003e\u003c/a\u003e\n\n## verify(hash, input) ⇒ \u003ccode\u003ePromise.\u0026lt;boolean\u0026gt;\u003c/code\u003e\nDetermines whether or not the user's input matches the secure hashed password.\n\n**Kind**: global function  \n**Returns**: \u003ccode\u003ePromise.\u0026lt;boolean\u0026gt;\u003c/code\u003e - A boolean that is true if the hash computed\nfor the input matches.  \n**Access**: public  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| hash | \u003ccode\u003estring\u003c/code\u003e | Secure hash string generated from this package. |\n| input | \u003ccode\u003estring\u003c/code\u003e | User's password input. |\n\n## Contributing\nContributions are REALLY welcome and if you find a security flaw in this code, PLEASE [report it](https://github.com/simonepri/pbkdf2-crypt/issues/new).  \nPlease check the [contributing guidelines](.github/contributing.md) for more details. Thanks!\n\n## Authors\n- **Simone Primarosa** -  *Follow* me on *Github* ([:octocat:@simonepri](https://github.com/simonepri)) and on  *Twitter* ([🐦@simonepri](http://twitter.com/intent/user?screen_name=simoneprimarosa))\n\nSee also the list of [contributors](https://github.com/simonepri/pbkdf2-crypt/contributors) who participated in this project.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/simonepri/pbkdf2-crypt/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fpbkdf2-crypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fpbkdf2-crypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fpbkdf2-crypt/lists"}