{"id":13413781,"url":"https://github.com/dwin/goArgonPass","last_synced_at":"2025-03-14T20:30:37.933Z","repository":{"id":55857422,"uuid":"135371721","full_name":"dwin/goArgonPass","owner":"dwin","description":"goArgonPass is a Argon2 Password utility package for Go using the crypto library package Argon2 designed to be compatible with Passlib for Python and Argon2 PHP. Argon2 was the winner of the most recent Password Hashing Competition. This is designed for use anywhere password hashing and verification might be needed and is intended to replace implementations using bcrypt or Scrypt.","archived":false,"fork":false,"pushed_at":"2020-12-11T04:07:56.000Z","size":244,"stargazers_count":20,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T10:57:14.054Z","etag":null,"topics":["argon","argon2","argon2i","argon2id","go","go-library","golang","golang-library","passlib","password","password-hash","password-hashing","password-security","password-store","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/dwin.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":"2018-05-30T01:32:10.000Z","updated_at":"2025-02-26T03:41:03.000Z","dependencies_parsed_at":"2022-08-15T07:51:21.969Z","dependency_job_id":null,"html_url":"https://github.com/dwin/goArgonPass","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwin%2FgoArgonPass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwin%2FgoArgonPass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwin%2FgoArgonPass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwin%2FgoArgonPass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwin","download_url":"https://codeload.github.com/dwin/goArgonPass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243641954,"owners_count":20323940,"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":["argon","argon2","argon2i","argon2id","go","go-library","golang","golang-library","passlib","password","password-hash","password-hashing","password-security","password-store","passwords"],"created_at":"2024-07-30T20:01:49.178Z","updated_at":"2025-03-14T20:30:37.439Z","avatar_url":"https://github.com/dwin.png","language":"Go","funding_links":[],"categories":["Security","安全","安全领域相关库","安全性","Relational Databases"],"sub_categories":["HTTP Clients","HTTP客户端","Advanced Console UIs","查询语","交流"],"readme":"# goArgonPass\n\n[![GoDoc](https://godoc.org/github.com/dwin/goArgonPass?status.svg)](https://godoc.org/github.com/dwin/goArgonPass)\n[![codecov](https://codecov.io/gh/dwin/goArgonPass/branch/master/graph/badge.svg)](https://codecov.io/gh/dwin/goArgonPass)\n[![Go Report Card](https://goreportcard.com/badge/github.com/dwin/goArgonPass)](https://goreportcard.com/report/github.com/dwin/goArgonPass)\n[![CodeFactor](https://www.codefactor.io/repository/github/dwin/goargonpass/badge)](https://www.codefactor.io/repository/github/dwin/goargonpass)\n\nTravis: \n\n[![Travis Build Status](https://travis-ci.org/dwin/goArgonPass.svg?branch=master)](https://travis-ci.org/dwin/goArgonPass)\n\nDrone: \n\n[![Drone Build Status](https://drone.github.dlsmi.com/api/badges/dwin/goArgonPass/status.svg)](https://drone.github.dlsmi.com/dwin/goArgonPass)\n\n\n\n**_All hashing and crypto is done by Go library packages. This is only a utility package to make the process described easier._**\n\n## Description\n\ngoArgonPass is a Argon2 Password utility package for Go using the crypto library package [Argon2](https://godoc.org/golang.org/x/crypto/argon2). Argon2 was the winner of the most recent [Password Hashing Competition](https://password-hashing.net/#phc) and doesn't suffer from issues that Bcrypt has such as truncating input over 72 characters. This is designed for use anywhere password hashing and verification might be needed and is intended to replace implementations using bcrypt or Scrypt. The string input/output format was designed to be compatible with [Passlib for Python](https://passlib.readthedocs.io/en/stable/lib/passlib.hash.argon2.html) and [Argon2 PHP](https://wiki.php.net/rfc/argon2_password_hash), and you should have full compatibility using the `argon2i` function, but will not be able to use `argon2id`, which is the default for this pacakge until those libraries are updated to support it. I encourage you to find the parameters that work best for your application, but the defaults are resonable for an interactive use such as a web application login.\n\nThe default Argon2 function is `Argon2id`, which is a hybrid version of Argon2 combining Argon2i and Argon2d. Argon2id is side-channel resistant and provides better brute- force cost savings due to time-memory tradeoffs than Argon2i, but Argon2i is still plenty secure.\n\n[IETF Recommendation](https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-9.4) is:\n\n\u003e Argon2id variant with t=1 and maximum available memory is recommended as a default setting for all environments. This setting is secure against side-channel attacks and maximizes adversarial costs on dedicated bruteforce hardware.\n\n## Get Started\n\n```bash\ngo get github.com/dwin/goArgonPass\n```\n\nSee [example/example.go](https://github.com/dwin/goArgonPass/blob/master/example/example.go):\n\n```go\nimport (\n    \"fmt\"\n    \"os\"\n\n    argonpass \"github.com/dwin/goArgonPass\"\n)\n\nfunc main() {\n    // Obtain user password from form or other input\n    userPassInput := \"password\"\n\n    // Hash with Default Parameters\n    hash, err := argonpass.Hash(userPassInput, nil)\n    if err != nil {\n        // Handle Error\n        os.Exit(1)\n    }\n    fmt.Println(\"Hash Output: \", hash)\n    // Verify Hash\n    err = argonpass.Verify(userPassInput, hash)\n    if err != nil {\n        fmt.Println(\"Hash verification error: \", err)\n    }\n    fmt.Println(\"Hash verified\")\n}\n\n```\n\n### Output Format\n\n```bash\n$ argon2id$v=19$m=65536,t=1,p=4$in2Oi1x57p0=$FopwSR12aLJ9OGPw1rKU5K5osAOGxOJzxC/shk+i850=\n\n$ argon2{function(i/id)}$v={version}$m={memory},t={time},p={parallelism}${salt(base64)}${digest(base64)}\n```\n\n### Other Notes\n\n#### Custom Parameters\n\nSet Custom Parameters by passing ArgonParams{} to Hash().\n\n| Parameter   |      Type      |      Default      |                        Valid Range |\n| ----------- | :------------: | :---------------: | ---------------------------------: |\n| Time        |    `uint32`    |        `1`        |                             `\u003e= 1` |\n| Memory      |    `uint32`    |      `65536`      |                          `\u003e= 1024` |\n| Parallelism |    `uint8`     |        `4`        |                             `1-64` |\n| OutputSize  |    `uint32`    |        `16`       |                            `16-64` |\n| Function    | `ArgonVariant` | `ArgonVariant2id` | `ArgonVariant2id - ArgonVariant2i` |\n| SaltSize    |    `uint8`     |        `16`       |                            `16-64` |\n\n```go\ntype ArgonParams struct {\n    Time        uint32\n    Memory      uint32\n    Parallelism uint8\n    OutputSize  uint32\n    Function    ArgonVariant\n    SaltSize    uint8\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwin%2FgoArgonPass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwin%2FgoArgonPass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwin%2FgoArgonPass/lists"}