{"id":36860230,"url":"https://github.com/usvc/go-password","last_synced_at":"2026-01-12T14:49:26.987Z","repository":{"id":57515619,"uuid":"241646776","full_name":"usvc/go-password","owner":"usvc","description":"A Go package to manage password hashing, verification, and validation","archived":false,"fork":false,"pushed_at":"2020-03-17T12:03:51.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T09:37:04.817Z","etag":null,"topics":["go","golang","golang-library","golang-module","password","password-validation","password-validator","passwords"],"latest_commit_sha":null,"homepage":"","language":"Go","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/usvc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-19T14:46:43.000Z","updated_at":"2024-08-12T08:08:51.000Z","dependencies_parsed_at":"2022-09-26T18:00:39.176Z","dependency_job_id":null,"html_url":"https://github.com/usvc/go-password","commit_stats":null,"previous_names":["usvc/password"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/usvc/go-password","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usvc","download_url":"https://codeload.github.com/usvc/go-password/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usvc%2Fgo-password/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","golang-library","golang-module","password","password-validation","password-validator","passwords"],"created_at":"2026-01-12T14:49:26.891Z","updated_at":"2026-01-12T14:49:26.972Z","avatar_url":"https://github.com/usvc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Password\n\n[![latest release](https://badge.fury.io/gh/usvc%2Fgo-password.svg)](https://github.com/usvc/go-password/releases)\n[![build status](https://travis-ci.org/usvc/go-password.svg?branch=master)](https://travis-ci.org/usvc/go-password)\n[![pipeline status](https://gitlab.com/usvc/modules/go/password/badges/master/pipeline.svg)](https://gitlab.com/usvc/modules/go/password/-/commits/master)\n[![test coverage](https://api.codeclimate.com/v1/badges/1bdfbf587cb7feab08ae/test_coverage)](https://codeclimate.com/github/usvc/go-password/test_coverage)\n[![maintainability](https://api.codeclimate.com/v1/badges/1bdfbf587cb7feab08ae/maintainability)](https://codeclimate.com/github/usvc/go-password/maintainability)\n\nA Go package to manage password hashing, verification, and validation.\n\n| | |\n| --- | --- |\n| Github | [https://github.com/usvc/go-password](https://github.com/usvc/go-password) |\n| Gitlab | [https://gitlab.com/usvc/modules/go/password](https://gitlab.com/usvc/modules/go/password) |\n\n- - -\n\n- [Password](#password)\n  - [Usage](#usage)\n    - [Importing](#importing)\n    - [Hashing Passwords](#hashing-passwords)\n    - [Verifying Passwords](#verifying-passwords)\n    - [Validating Passwords](#validating-passwords)\n    - [Customizing Password Policies](#customizing-password-policies)\n  - [Development Runbook](#development-runbook)\n    - [Getting Started](#getting-started)\n    - [Continuous Integration (CI) Pipeline](#continuous-integration-ci-pipeline)\n      - [On Github](#on-github)\n        - [Releasing](#releasing)\n      - [On Gitlab](#on-gitlab)\n        - [Version Bumping](#version-bumping)\n  - [Licensing](#licensing)\n\n## Usage\n\n### Importing\n\n```go\nimport \"github.com/usvc/go-password\"\n```\n\n### Hashing Passwords\n\n```go\nplaintext := \"abcd1234!@#$\"\nhash, salt, err := password.Hash(plaintext, 32)\n// ...\n// store the hash and salt\n// ...\n```\n\n### Verifying Passwords\n\n```go\nstoredHash := \"\u003chash\u003e\"\nstoredSalt := \"\u003csalt\u003e\"\nplaintext := \"abcd1234!@#$\"\nerr := password.Verify(plaintext, storedHash, storedSalt)\nif err != nil {\n  // handle failed verification\n} else {\n  // handle successful verification\n}\n```\n\n### Validating Passwords\n\n```go\ndefaultPolicy := password.GetDefaultPolicy()\nplaintext := \"abcd1234!@#$\"\nif err := password.Validate(plaintext, defaultPolicy); err != nil {\n  // handle failed validation\n} else {\n  // handle successful validation\n}\n```\n\n### Customizing Password Policies\n\n```go\ncustomPolicy := password.Policy{\n  MaximumLength: 32,\n  MinimumLength: 12,\n  MinimumLowercaseCount: 1,\n  MinimumUppercaseCount: 1,\n  MinimumNumericCount: 1,\n  MinimumSpecialCount: 1,\n  CustomSpecial: []byte(\"`!@\"),\n}\nplaintext := \"abcd1234!@#$\"\nif err := password.Validate(plaintext, defaultPolicy); err != nil {\n  // handle failed validation\n} else {\n  // handle successful validation\n}\n```\n\n## Development Runbook\n\n### Getting Started\n\n1. Clone this repository\n2. Run `make deps` to pull in external dependencies\n3. Write some awesome stuff\n4. Run `make test` to ensure unit tests are passing\n5. Push\n\n\n\n### Continuous Integration (CI) Pipeline\n\n#### On Github\n\nGithub is used to deploy binaries/libraries because of it's ease of access by other developers.\n\n##### Releasing\n\nReleasing of the binaries can be done via Travis CI.\n\n1. On Github, navigate to the [tokens settings page](https://github.com/settings/tokens) (by clicking on your profile picture, selecting **Settings**, selecting **Developer settings** on the left navigation menu, then **Personal Access Tokens** again on the left navigation menu)\n2. Click on **Generate new token**, give the token an appropriate name and check the checkbox on **`public_repo`** within the **repo** header\n3. Copy the generated token\n4. Navigate to [travis-ci.org](https://travis-ci.org) and access the cooresponding repository there. Click on the **More options** button on the top right of the repository page and select **Settings**\n5. Scroll down to the section on **Environment Variables** and enter in a new **NAME** with `RELEASE_TOKEN` and the **VALUE** field cooresponding to the generated personal access token, and hit **Add**\n\n#### On Gitlab\n\n##### Version Bumping\n\nTo set up the CI pipeline in Gitlab:\n\n1. Run `make .ssh`\n2. Copy the contents of the file generated at `./.ssh/id_rsa.base64` into an environment variable named **`DEPLOY_KEY`** in **Settings \u003e CI/CD \u003e Variables**\n3. Navigate to the **Deploy Keys** section of the **Settings \u003e Repository \u003e Deploy Keys** and paste in the contents of the file generated at `./.ssh/id_rsa.pub` with the **Write access allowed** checkbox enabled\n\n- **`DEPLOY_KEY`**: generate this by running `make .ssh` and copying the contents of the file generated at `./.ssh/id_rsa.base64`\n\n## Licensing\n\nCode in this package is licensed under the [MIT license (click to view text)](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusvc%2Fgo-password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusvc%2Fgo-password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusvc%2Fgo-password/lists"}