{"id":17355125,"url":"https://github.com/zephinzer/authasher","last_synced_at":"2025-10-30T09:19:55.498Z","repository":{"id":57187111,"uuid":"87063844","full_name":"zephinzer/authasher","owner":"zephinzer","description":"Sub-component of authentication module to handle hashing for password storage","archived":false,"fork":false,"pushed_at":"2017-04-04T16:53:58.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T09:42:59.093Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zephinzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-03T10:47:55.000Z","updated_at":"2017-04-04T16:54:26.000Z","dependencies_parsed_at":"2022-08-28T13:00:19.219Z","dependency_job_id":null,"html_url":"https://github.com/zephinzer/authasher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fauthasher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fauthasher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fauthasher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephinzer%2Fauthasher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephinzer","download_url":"https://codeload.github.com/zephinzer/authasher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858880,"owners_count":20684062,"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-15T17:42:23.782Z","updated_at":"2025-10-30T09:19:50.444Z","avatar_url":"https://github.com/zephinzer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authasher\n\n[![Code Climate](https://codeclimate.com/github/zephinzer/authasher/badges/gpa.svg)](https://codeclimate.com/github/zephinzer/authasher)\n[![Build Status](https://travis-ci.org/zephinzer/authasher.svg?branch=master)](https://travis-ci.org/zephinzer/authasher)\n\n## Compatibility\nAuthasher is tested to be compatible with the following versions of Node: `0.10.42`, `0.12.13`, `4`, `5`, `6`, `7`.\n\n## Installation \u0026 Usage\nInstall authasher with NPM \n\n```bash\n# npm install authasher --save\n```\n\nOr install it with Yarn\n\n```bash\n# yarn add authasher\n```\n\nInclude and use it in your project:\n\n```javascript\nconst authasher = require('authasher');\nconst password = 'p@ssw0rd';\nconst hashedToken = authasher.create(password);\nconst result = authasher.validate(password, hashedToken);\nconsole.log(result);\n/**\n * result = {\n *   valid: true,\n *   expired: false,\n *   corrupt: false\t \n * }\n **/\n```\n\n## Options\nThe available options to modify the hashing are:\n- `algorithm`\n  - changes the encryption algorithm\n  - defaults to `aes192`\n- `hashing`\n  - changes the hashing algorithm\n  - defaults to `sha512`\n- `timeValidity`\n  - time that the hashed token should be valid for\n- `iterations`\n\t- number of PBKDF2 iterations\n\t- defaults to `8192`\n- `keyLength`\n\t- length of generated keys\n\t- defaults to `32`\n\n## API\n### `authasher::create(password, options)`\n- `password` : String\n  - the password you wish to hash\n- `options` : Object\n  - options\n\nThis function creates a hash token from the provided password. Returns a hash token of type `String`.\n\n### `authasher::validate(password, storedToken, options)`\n- `password` : String\n  - the challenging password to validate\n- `storedToken` : String\n  - a stored token generated from `authasher::create`\n- `options` : Object\n  - options\n\nThis function validates a hash token generated from `authasher::create` (`:storedToken`) with a challenge password (`password`). Returns an object of the following structure:\n\n```json\n{\n\tvalid : Boolean,\n\texpired : Boolean,\n\tcorrupt : Boolean\n}\n```\n\n## Contributing\n\n### Overview\nFork it, make your changes and raise a pull request. Please include the relevant tests in the `/test` folder.\n\n### Installing the devDependencies\nAfter forking the repository and cloning it locally, run the following command to install the devDependencies with NPM:\n\n```bash\n# npm install --only=dev\n```\n\nOr run the analogous command to install it with Yarn:\n\n```bash\n# yarn install \n```\n### Testing\nTests are written with the `mocha` testing framework and the `chai` assertion library.\n\n## Changelog\n\n- Version 1.0.0\n  - Initial release","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fauthasher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephinzer%2Fauthasher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephinzer%2Fauthasher/lists"}