{"id":16834869,"url":"https://github.com/dchest/pbkdf2","last_synced_at":"2025-04-11T04:35:39.977Z","repository":{"id":57484172,"uuid":"1564135","full_name":"dchest/pbkdf2","owner":"dchest","description":"Go implementation of PBKDF2 key derivation function. (Modified original from https://bitbucket.org/taruti/pbkdf2.go) DEPRECATED. Please use the one from the official go.crypto repo: http://code.google.com/p/go/source/browse?repo=crypto#hg%2Fpbkdf2","archived":false,"fork":false,"pushed_at":"2012-02-09T18:51:39.000Z","size":100,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T04:35:36.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dchest.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":"2011-04-03T19:46:47.000Z","updated_at":"2024-02-23T19:34:38.000Z","dependencies_parsed_at":"2022-08-26T14:21:52.908Z","dependency_job_id":null,"html_url":"https://github.com/dchest/pbkdf2","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fpbkdf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fpbkdf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fpbkdf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Fpbkdf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dchest","download_url":"https://codeload.github.com/dchest/pbkdf2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345257,"owners_count":21088231,"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-13T12:08:11.129Z","updated_at":"2025-04-11T04:35:39.952Z","avatar_url":"https://github.com/dchest.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Package pbkdf2\n==============\n\nPackage pbkdf2 implements PBKDF2 key derivation function.\n\n(Slightly modified version of https://bitbucket.org/taruti/pbkdf2.go,\nwith password helper functions removed)\n\n\nFunctions\n---------\n\n### func WithHMAC\n\n\tfunc WithHMAC(hash func() hash.Hash, password []byte, salt []byte, iterations int, outlen int) []byte\n\nWithHMAC derives key of length outlen from the provided password, salt,\nand the number of iterations using PKCS#5 PBKDF2 with the provided\nhash function in HMAC.\n\nCaller is responsible to make sure that outlen \u003c (2^32-1) * hash.Size().\n\n\nExample\n-------\n\n\tpackage main\n\n\timport (\n\t\t\"fmt\"\n\t\t\"crypto/rand\"\n\t\t\"crypto/sha256\"\n\t\t\"github.com/dchest/pbkdf2\"\n\t)\n\n\n\tfunc main() {\n\t\tpassword := \"hello\"\n\t\t// Get random salt\n\t\tsalt := make([]byte, 32)\n\t\tif _, err := rand.Reader.Read(salt); err != nil {\n\t\t\tpanic(\"random reader failed\")\n\t\t}\n\t\t// Derive key\n\t\tkey := pbkdf2.WithHMAC(sha256.New, password, salt, 9999, 64)\n\t\tfmt.Printf(\"%x\", key)\n\t}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Fpbkdf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdchest%2Fpbkdf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Fpbkdf2/lists"}