{"id":16617081,"url":"https://github.com/agnivade/easy-scrypt","last_synced_at":"2025-07-22T17:34:24.254Z","repository":{"id":21389645,"uuid":"24707364","full_name":"agnivade/easy-scrypt","owner":"agnivade","description":"This is a nice and simple wrapper in Go over the scrypt password based key derivation algorithm.","archived":false,"fork":false,"pushed_at":"2022-11-03T10:17:01.000Z","size":21,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T01:23:20.073Z","etag":null,"topics":["hashing","passwords","scrypt"],"latest_commit_sha":null,"homepage":null,"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/agnivade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-02T05:18:44.000Z","updated_at":"2025-01-07T05:42:53.000Z","dependencies_parsed_at":"2022-07-30T04:37:56.221Z","dependency_job_id":null,"html_url":"https://github.com/agnivade/easy-scrypt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/agnivade/easy-scrypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnivade%2Feasy-scrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnivade%2Feasy-scrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnivade%2Feasy-scrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnivade%2Feasy-scrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agnivade","download_url":"https://codeload.github.com/agnivade/easy-scrypt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agnivade%2Feasy-scrypt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266539766,"owners_count":23945083,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["hashing","passwords","scrypt"],"created_at":"2024-10-12T02:15:13.204Z","updated_at":"2025-07-22T17:34:24.230Z","avatar_url":"https://github.com/agnivade.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"easy-scrypt [![Go Report Card](https://goreportcard.com/badge/github.com/agnivade/easy-scrypt)](https://goreportcard.com/report/github.com/agnivade/easy-scrypt) [![codecov](https://codecov.io/gh/agnivade/easy-scrypt/branch/master/graph/badge.svg)](https://codecov.io/gh/agnivade/easy-scrypt) [![GoDoc](https://godoc.org/github.com/agnivade/easy-scrypt?status.svg)](https://godoc.org/github.com/agnivade/easy-scrypt)\n===========\n\nThis is a nice and simple wrapper in Go over the raw scrypt libraries available. There are just 2 calls exposed by the library(and should be!) which makes it super easy to embed in any of your projects.\n\nYou can use it to -\n\n1. Safely hash passwords.\n2. Hash a passphrase to get a derived key.\n3. Let me know if you find other uses .. :)\n\nQuick start\n-----\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/agnivade/easy-scrypt\"\n)\n\nfunc main() {\n\tpassphrase := \"Hello there this is a sample passphrase\"\n\n\tkey, err := scrypt.DerivePassphrase(passphrase, 32)\n\tif err != nil {\n\t\tfmt.Errorf(\"Error returned: %s\\n\", err)\n\t}\n\n\tfmt.Printf(\"Key returned - %v\\n\", key)\n\tvar result bool\n\n\tresult, err = scrypt.VerifyPassphrase(passphrase, key)\n\tif err != nil {\n\t\tfmt.Errorf(\"Error returned: %s\\n\", err)\n\t}\n\tif !result {\n\t\tfmt.Errorf(\"Passphrase did not match\\n\")\n\t} else {\n\t\tfmt.Printf(\"Passphrase matched successfully\\n\")\n\t}\n}\n```\n\nImplementation Details\n----------------------\n\nThe scrypt call is invoked with these params -\nN = 16384\nr = 8\np = 1\n\nThe salt is randomly generated from the crypto/rand library which generates a cryptographically secure pseudorandom number.\n\nThe returned key will be of x+60 bytes in length where x is the key length passed to the call. The key returned is of this format -\n\n```\narray index starts from left.\n\u003c-----x-----\u003e\u003c----16----\u003e\u003c--4--\u003e\u003c--4--\u003e\u003c--4--\u003e\u003c----32----\u003e\n    dKey          salt      N      r      p   sha-256 hash\n```\n\nA SHA-256 of the entire content(dKey+salt+n+r+p) is computed and stored at the end to just verify the integrity of the content.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagnivade%2Feasy-scrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagnivade%2Feasy-scrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagnivade%2Feasy-scrypt/lists"}