{"id":20664508,"url":"https://github.com/outr/scalapass","last_synced_at":"2025-04-19T16:24:15.512Z","repository":{"id":38015586,"uuid":"158577674","full_name":"outr/scalapass","owner":"outr","description":"Useful tools for managing storage and validation of passwords in Scala applications","archived":false,"fork":false,"pushed_at":"2024-05-05T00:58:07.000Z","size":1158,"stargazers_count":5,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-05T01:37:04.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/outr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-21T16:34:55.000Z","updated_at":"2024-05-05T01:37:10.847Z","dependencies_parsed_at":"2024-05-05T01:47:09.793Z","dependency_job_id":null,"html_url":"https://github.com/outr/scalapass","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fscalapass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fscalapass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fscalapass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fscalapass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outr","download_url":"https://codeload.github.com/outr/scalapass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224960001,"owners_count":17398794,"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-11-16T19:24:42.701Z","updated_at":"2024-11-16T19:24:43.210Z","avatar_url":"https://github.com/outr.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scalapass\n[![CI](https://github.com/outr/scalapass/actions/workflows/ci.yml/badge.svg)](https://github.com/outr/scalapass/actions/workflows/ci.yml)\n\nStraight-forward password hashing and verification using the latest algorithms. Currently, supports:\n* Argon2(i, d, and id)\n* PBKDF2\n\n## SBT\n```sbt\nlibraryDependencies += \"com.outr\" %% \"scalapass\" % \"1.2.8\"\n```\n\n## Creating a hash\n```scala\nimport com.outr.scalapass.Argon2PasswordFactory\n\nval factory = Argon2PasswordFactory()\n// factory: Argon2PasswordFactory = Argon2PasswordFactory(\n//   iterations = 50,\n//   memory = 65536,\n//   parallelism = 8,\n//   argon2 = id,\n//   saltLength = 16,\n//   hashLength = 32\n// )\nval password: String = \"your-password-in-clear-text\"\n// password: String = \"your-password-in-clear-text\"\nval hashed: String = factory.hash(password)\n// hashed: String = \"$argon2id$v=19$m=65536,t=50,p=8$ERV4kw6eytqaCeZkb9+ocA$ECwWfIUIu7n/is0ryxNrbK4szxEgpkfV6eVAkWKF4AU\"\n```\n\nNow store the one-way hashed password safely in your database.\n\n## Verifying a hash\n```scala\nval attemptedPassword: String = \"your-password-in-clear-text\"\n// attemptedPassword: String = \"your-password-in-clear-text\"\nval hashedPassword: String = hashed  // From the database\n// hashedPassword: String = \"$argon2id$v=19$m=65536,t=50,p=8$ERV4kw6eytqaCeZkb9+ocA$ECwWfIUIu7n/is0ryxNrbK4szxEgpkfV6eVAkWKF4AU\"  // From the database\nval valid: Boolean = factory.verify(attemptedPassword, hashedPassword)\n// valid: Boolean = true\n```\n\nWill return `true` if the `attemptedPassword` is the same as the one used to create the `hashedPassword`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutr%2Fscalapass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutr%2Fscalapass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutr%2Fscalapass/lists"}