{"id":13610119,"url":"https://github.com/aldy505/phc-crypto","last_synced_at":"2025-04-15T05:53:02.773Z","repository":{"id":47146153,"uuid":"370675071","full_name":"aldy505/phc-crypto","owner":"aldy505","description":"Hashing algorithms simplified (supports Argon2, Bcrypt, Scrypt, and PBKDF2)","archived":false,"fork":false,"pushed_at":"2024-06-27T11:15:43.000Z","size":100,"stargazers_count":26,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T05:52:57.480Z","etag":null,"topics":["argon2","bcrypt","crypto","cryptography","go","golang","hash","pbkdf2","phc","scrypt"],"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/aldy505.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-25T11:51:42.000Z","updated_at":"2024-11-04T13:03:10.000Z","dependencies_parsed_at":"2024-08-01T19:43:54.026Z","dependency_job_id":"c04f0a11-bf67-4f13-94c5-7d57a68d74b3","html_url":"https://github.com/aldy505/phc-crypto","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fphc-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fphc-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fphc-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fphc-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldy505","download_url":"https://codeload.github.com/aldy505/phc-crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016319,"owners_count":21198832,"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":["argon2","bcrypt","crypto","cryptography","go","golang","hash","pbkdf2","phc","scrypt"],"created_at":"2024-08-01T19:01:41.429Z","updated_at":"2025-04-15T05:53:02.754Z","avatar_url":"https://github.com/aldy505.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# PHC Crypto\n\n[![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/aldy505/phc-crypto?include_prereleases)](https://github.com/aldy505/phc-crypto/releases) [![Go Reference](https://pkg.go.dev/badge/github.com/aldy505/phc-crypto.svg)](https://pkg.go.dev/github.com/aldy505/phc-crypto) [![Go Report Card](https://goreportcard.com/badge/github.com/aldy505/phc-crypto)](https://goreportcard.com/report/github.com/aldy505/phc-crypto) [![GitHub](https://img.shields.io/github/license/aldy505/phc-crypto)](https://github.com/aldy505/phc-crypto/blob/master/LICENSE) [![codecov](https://codecov.io/gh/aldy505/phc-crypto/branch/master/graph/badge.svg?token=HUTQURBZ73)](https://codecov.io/gh/aldy505/phc-crypto) [![CodeFactor](https://www.codefactor.io/repository/github/aldy505/phc-crypto/badge)](https://www.codefactor.io/repository/github/aldy505/phc-crypto) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/16c40f49aabe4e89afea7c1e1d90a483)](https://www.codacy.com/gh/aldy505/phc-crypto/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=aldy505/phc-crypto\u0026amp;utm_campaign=Badge_Grade) [![Build test](https://github.com/aldy505/phc-crypto/actions/workflows/build.yml/badge.svg)](https://github.com/aldy505/phc-crypto/actions/workflows/build.yml) [![Build test](https://github.com/aldy505/phc-crypto/actions/workflows/coverage.yml/badge.svg)](https://github.com/aldy505/phc-crypto/actions/workflows/coverage.yml)\n\nInspired by [Upash](https://github.com/simonepri/upash), also\nimplementing [PHC string format](https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md)\n\n## Usage\n\nCurrently there are two options of using this package:\n\n1. Import all\n2. Import specific hash function\n\nBear in mind, these usage function might be changed in the near future.\n\n### Currently supported formats\n\n* Bcrypt\n* Argon2i \u0026 Argon2id\n* PBKDF2\n* Scrypt\n\nFor details regarding configs, please refer to their own directory.\n\n### Option 1 - Import all\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/aldy505/phc-crypto\"\n)\n\nfunc main() {\n\t// Create a crypto instance\n\t// Change the scope name to your prefered hashing algorithm\n\t// Available options are: Bcrypt, Scrypt, Argon2, PBKDF2\n\tcrypto, err := phccrypto.Use(phccrypto.Scrypt, phccrypto.Config{})\n\n\thash, err := crypto.Hash(\"password123\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(hash) // returns string ($scrypt$v=0$p=1,ln=32768,r=8$402ffb0b23cd3d3a$62daeae2ac...)\n\n\tverify, err := crypto.Verify(hash, \"password123\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(verify) // returns boolean (true/false)\n}\n```\n\n### Option 2 - Import specific hash function\n\n```go\npackage main\n\nimport \"github.com/aldy505/phc-crypto/scrypt\"\n\nfunc main() {\n\t// Change the scope name to your prefered hashing algorithm\n\thash, err := scrypt.Hash(\"password123\", scrypt.Config{})\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(hash) // returns string ($scrypt$v=0$p=1,ln=32768,r=8$402ffb0b23cd3d3a$62daeae2ac...)\n\n\tverify, err := scrypt.Verify(hash, \"password123\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\tfmt.Println(verify) // returns boolean (true/false)\n}\n```\n\n## Contribute\n\nYes please! I'm still new to Go and I create this module (or package if you will) to help me fulfill a need on my\nproject. Feel free to refactor, add new feature, fix unknown bugs, and have fun!\n\n## LICENSE\n\n```\nMIT License\n\nCopyright (c) 2024 Reinaldy Rafli and PHC Crypto collaborators\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldy505%2Fphc-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldy505%2Fphc-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldy505%2Fphc-crypto/lists"}