{"id":16473218,"url":"https://github.com/saintedlama/passport-local-authenticate","last_synced_at":"2025-03-23T11:32:50.039Z","repository":{"id":30172004,"uuid":"33722374","full_name":"saintedlama/passport-local-authenticate","owner":"saintedlama","description":"Encapsulates methods used to hash and verify user credentials for use in a passport-local strategy.","archived":false,"fork":false,"pushed_at":"2023-06-21T18:06:10.000Z","size":9,"stargazers_count":7,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T20:07:48.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/saintedlama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-10T10:14:31.000Z","updated_at":"2023-08-28T20:52:10.000Z","dependencies_parsed_at":"2024-06-19T00:10:12.832Z","dependency_job_id":null,"html_url":"https://github.com/saintedlama/passport-local-authenticate","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.25,"last_synced_commit":"ad8321dbf8f82d89bec742912d2fb51f5b81949a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintedlama%2Fpassport-local-authenticate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintedlama%2Fpassport-local-authenticate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintedlama%2Fpassport-local-authenticate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintedlama%2Fpassport-local-authenticate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saintedlama","download_url":"https://codeload.github.com/saintedlama/passport-local-authenticate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245097158,"owners_count":20560311,"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":[],"created_at":"2024-10-11T12:25:51.449Z","updated_at":"2025-03-23T11:32:49.778Z","avatar_url":"https://github.com/saintedlama.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Passport-Local-Authenticate\nEncapsulates methods used to hash and verify user credentials for use in a passport-local strategy. This simplifies building username and password login with [Passport](http://passportjs.org).\n\n[![Build Status](https://travis-ci.org/saintedlama/passport-local-authenticate.png?branch=master)](https://travis-ci.org/saintedlama/passport-local-authenticate)\n[![Coverage Status](https://coveralls.io/repos/github/saintedlama/passport-local-authenticate/badge.svg?branch=master)](https://coveralls.io/github/saintedlama/passport-local-authenticate?branch=master)\n\n## Installation\n\n    $ npm install passport-local-authenticate --save\n\n## Usage\n\n    var auth = require('passport-local-authenticate');\n\n    auth.hash('password', function(err, hashed) {\n      console.log(hashed.hash); // Hashed password\n      console.log(hashed.salt); // Salt\n    });\n\n    auth.hash('password', function(err, hashed) {\n      auth.verify('password', hashed, function(err, verified) {\n        console.log(verified); // True, passwords match\n      ));\n    });\n\n    auth.hash('password', function(err, hashed) {\n      auth.verify('password2', hashed, function(err, verified) {\n        console.log(verified); // False, passwords don't match\n      ));\n    });\n\n**Attention** options.digestAlgorithm is set to 'SHA1' which is not considered too safe but was \nchosen for backward compatibility.\nFuture versions (major) will use some 'SHA-256' digest algorithm!\n\n## Options\n*Attention!* Changing any of the hashing options (saltlen, iterations or keylen) in a production environment will prevent that existing users to authenticate!\n\n* saltlen: specifies the salt length in bytes. Default: 32\n* iterations: specifies the number of iterations used in pbkdf2 hashing algorithm. Default: 25000\n* keylen: specifies the length in byte of the generated key. Default: 512\n* encoding: specifies the encoding the generated salt and hash will be stored in. Defaults to 'hex'.\n* digestAlgorithm: digest algorith to use in pbkdf2. Valid values can be retrieved using crypto.getHashes().\n    A popular choices is 'sha256' or 'sha512'.\n    **Attention** Only working in node.js versions greater 0.10.  And in case your sitting on a 0.10 project consider an upgrade. Really! \n\n### Hash Algorithm\nPassport-Local-Authenticate uses the pbkdf2 algorithm of the node crypto library. \n[Pbkdf2](http://en.wikipedia.org/wiki/PBKDF2) was chosen because platform independent\n(in contrary to bcrypt). For every user a generated salt value is saved to make\nrainbow table attacks even harder.\n\n## License\nPassport-Local-Authenticate is licenses under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaintedlama%2Fpassport-local-authenticate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaintedlama%2Fpassport-local-authenticate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaintedlama%2Fpassport-local-authenticate/lists"}