{"id":15034933,"url":"https://github.com/wuriyanto48/go-pbkdf2","last_synced_at":"2025-08-22T11:36:09.307Z","repository":{"id":57490618,"uuid":"89908510","full_name":"wuriyanto48/go-pbkdf2","owner":"wuriyanto48","description":"a Go package for hash and verify a password using PBKDF2","archived":false,"fork":false,"pushed_at":"2022-10-15T06:17:40.000Z","size":19,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T22:52:39.242Z","etag":null,"topics":["cryptography","encrypt","go","golang","golang-application","golang-examples","golang-library","pbkdf2"],"latest_commit_sha":null,"homepage":"","language":"Go","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/wuriyanto48.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-05-01T08:22:05.000Z","updated_at":"2024-08-27T02:10:31.000Z","dependencies_parsed_at":"2022-08-30T01:10:37.567Z","dependency_job_id":null,"html_url":"https://github.com/wuriyanto48/go-pbkdf2","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wuriyanto48/go-pbkdf2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuriyanto48%2Fgo-pbkdf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuriyanto48%2Fgo-pbkdf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuriyanto48%2Fgo-pbkdf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuriyanto48%2Fgo-pbkdf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuriyanto48","download_url":"https://codeload.github.com/wuriyanto48/go-pbkdf2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuriyanto48%2Fgo-pbkdf2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271630343,"owners_count":24793299,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cryptography","encrypt","go","golang","golang-application","golang-examples","golang-library","pbkdf2"],"created_at":"2024-09-24T20:26:52.436Z","updated_at":"2025-08-22T11:36:09.287Z","avatar_url":"https://github.com/wuriyanto48.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GO PBKDF2\n\nPBKDF2 (Password-Based Key Derivation Function 2) https://en.wikipedia.org/wiki/PBKDF2\n\n[![Build Status](https://travis-ci.org/wuriyanto48/go-pbkdf2.svg?branch=master)](https://travis-ci.org/wuriyanto48/go-pbkdf2)\n[![go-pbkdf2 CI](https://github.com/wuriyanto48/go-pbkdf2/actions/workflows/ci.yml/badge.svg)](https://github.com/wuriyanto48/go-pbkdf2/actions/workflows/ci.yml)\n\n**This Implementation Based On**\nPackage pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.\nhttps://godoc.org/golang.org/x/crypto/pbkdf2\n\n# USAGE\n\n## Use as a library\n\n- **Install:**\n\n```shell\ngo get github.com/wuriyanto48/go-pbkdf2\n```\n\n- **Hash a Password**\n```go\npackage main\n\nimport(\n\t\"fmt\"\n\t\"crypto/sha1\"\n\t\"github.com/wuriyanto48/go-pbkdf2\"\n)\n\nfunc main(){\n\tpass := p.NewPassword(sha1.New, 8, 32,15000)\n\thashed := pass.HashPassword(\"123456\")\n\tfmt.Println(hashed.CipherText)\n\tfmt.Println(hashed.Salt)\n}\n```\n\n- **Verify a Password**\n```go\npackage main\n\nimport(\n\t\"fmt\"\n\t\"crypto/sha1\"\n\t\"github.com/wuriyanto48/go-pbkdf2\"\n)\n\nfunc main(){\n\tpass := p.NewPassword(sha1.New, 8, 32,15000)\n\thashed := pass.HashPassword(\"123456\")\n\tfmt.Println(hashed.CipherText)\n\tfmt.Println(hashed.Salt)\n\n\tisValid := pass.VerifyPassword(\"123456\", hashed.CipherText, hashed.Salt)\n\n\tfmt.Println(isValid)\n}\n```\n\n## Use as a binary\n\nbuild\n```shell\n$ make build\n```\n\nshow available options\n```shell\n$ ./go-pbkdf2 -h\n```\n\n# Doc\n\n- **func NewPassword**\n\t```go\n\tfunc NewPassword(func() hash.Hash, saltSize int, keyLen int, iterations int) *Password\n\t```\n\tthe drafted v2.1 specification allows use of all five FIPS Approved\n\tHash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To\n\tchoose, you can pass the `New` functions from the different SHA packages to\n\tpbkdf2.Key.\n\n- **func HashPassword**\n\t```go\n\tfunc HashPassword(\"123456\")\n\t```\n\tthis function returning HashResult(struct) Which has two fields, CiphertText and Salt\n\n- **func VerifyPassword**\n\t```go\n\tfunc VerifyPassword(\"123456\", hashed.CipherText, hashed.Salt) (bool)\n\t```\n\tthis function returning true if your password is valid and false otherwise\n\t\n\t\n\t\n\t##\n\t\n\tWuriyanto Musobar 2017\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuriyanto48%2Fgo-pbkdf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuriyanto48%2Fgo-pbkdf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuriyanto48%2Fgo-pbkdf2/lists"}