{"id":13508764,"url":"https://github.com/vic/comeonin_ecto_password","last_synced_at":"2025-03-16T14:30:56.538Z","repository":{"id":57484797,"uuid":"50173560","full_name":"vic/comeonin_ecto_password","owner":"vic","description":"Ecto type for saving encrypted passwords using Comeonin","archived":false,"fork":false,"pushed_at":"2019-10-25T14:34:58.000Z","size":22,"stargazers_count":35,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T10:17:35.660Z","etag":null,"topics":["comeonin","ecto","password-hash"],"latest_commit_sha":null,"homepage":"https://github.com/elixircnx/comeonin","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vic.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":"2016-01-22T10:08:32.000Z","updated_at":"2023-09-01T08:49:49.000Z","dependencies_parsed_at":"2022-08-26T11:10:32.390Z","dependency_job_id":null,"html_url":"https://github.com/vic/comeonin_ecto_password","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fcomeonin_ecto_password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fcomeonin_ecto_password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fcomeonin_ecto_password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fcomeonin_ecto_password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vic","download_url":"https://codeload.github.com/vic/comeonin_ecto_password/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818195,"owners_count":20352629,"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":["comeonin","ecto","password-hash"],"created_at":"2024-08-01T02:00:58.089Z","updated_at":"2025-03-16T14:30:56.066Z","avatar_url":"https://github.com/vic.png","language":"Elixir","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"# Comeonin Ecto Password \u003ca href=\"https://travis-ci.org/vic/comeonin_ecto_password\"\u003e\u003cimg src=\"https://travis-ci.org/vic/comeonin_ecto_password.svg\"\u003e\u003c/a\u003e\n\nA [custom Ecto type](https://hexdocs.pm/ecto/Ecto.Type.html#summary) for storing encrypted passwords using [Comeonin](https://github.com/elixircnx/comeonin)\n\nFor ecto 1 compatibility use the `ecto-1` branch.\n\n_Version 3.x is compatible with `comeonin` ~\u003e 5.0_, use version 2.x for compatibility with older versions.\n\n## Usage\n\nOn your schema, define secure fields with this type:\n\n```elixir\nfield :password, Comeonin.Ecto.Password\n```\n\nThen on your changeset simply cast from plain-text params\n\n```elixir\nchangeset\n|\u003e cast(attrs, [:password])\n|\u003e validate_required([:password])\n```\n\nAfter casting the password will already be encrypted\nin the changeset, and can be saved to your table's\nstring column.\n\nTo check for validity, do something like:\n\n```elixir\nuser = Repo.get_by(User, email: \"me@example.org\")\nComeonin.Ecto.Password.valid?(\"plain_password\", user.password)\n```\n\n## Configuration\n\nIn your environment file, choose one of `Pbkdf2`, `Bcrypt`, `Argon2`.\nThe default is 'Pbkdf2`, but you still need to include it in your `mix.exs`!\n\n```elixir\nconfig :comeonin, Ecto.Password, Pbkdf2\n\n# when using pkbdf2\nconfig :comeonin, :pbkdf2_rounds, 120_000\nconfig :comeonin, :pbkdf2_salt_len, 512\n\n# when using bcrypt\nconfig :comeonin, :bcrypt_log_rounds, 14\n```\n\nAlso, be sure to look at [comeonin](https://github.com/elixircnx/comeonin#installation) [config](http://hexdocs.pm/comeonin/Comeonin.Config.html)\n\n## Installation\n\n[Available in Hex](https://hex.pm/packages/comeonin_ecto_password), the package can be installed as:\n\nAdd comeonin_ecto_password to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:comeonin_ecto_password, \"~\u003e 3.0.0\"}]\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Fcomeonin_ecto_password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvic%2Fcomeonin_ecto_password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Fcomeonin_ecto_password/lists"}