{"id":20279352,"url":"https://github.com/simplito/crypt-erl","last_synced_at":"2026-06-06T12:31:23.395Z","repository":{"id":89901810,"uuid":"310737703","full_name":"simplito/crypt-erl","owner":"simplito","description":"Erlang wrapper for unix libcrypt library","archived":false,"fork":false,"pushed_at":"2020-11-07T00:49:14.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T02:39:46.283Z","etag":null,"topics":["bcrypt","cryptography","erlang","libcrypt"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/simplito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-11-07T00:47:52.000Z","updated_at":"2020-11-07T01:06:40.000Z","dependencies_parsed_at":"2023-04-16T15:00:32.245Z","dependency_job_id":null,"html_url":"https://github.com/simplito/crypt-erl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simplito/crypt-erl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fcrypt-erl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fcrypt-erl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fcrypt-erl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fcrypt-erl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplito","download_url":"https://codeload.github.com/simplito/crypt-erl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplito%2Fcrypt-erl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33983046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["bcrypt","cryptography","erlang","libcrypt"],"created_at":"2024-11-14T13:29:37.342Z","updated_at":"2026-06-06T12:31:23.373Z","avatar_url":"https://github.com/simplito.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Erlang wrapper for unix libcrypt library\n\ncrypt-erl is a safe port wrapper for [crypt(3)](https://manpages.debian.org/crypt(3)) and [crypt_gensalt(3)](https://manpages.debian.org/crypt(3)) routines.\n\n## Basic usage example\n\nGenerating random salt for Blowfish (bcrypt) method and using it to hash \"Password\":\n\n```erlang\n1\u003e {ok, Salt} = crypt:gensalt(\"$2a$\").\n{ok,\"$2a$05$gwtgJ3kUiZSjqwVs91/wXe\"}\n2\u003e {ok, Hash} = crypt:crypt(\"Password\", Salt).\n{ok,\"$2a$05$gwtgJ3kUiZSjqwVs91/wXePGURhb0vMWeMHQKimYflWAic4o7qEHm\"}\n```\n\nVerifying password for given hash:\n```erlang\n1\u003e Verify = fun(Phrase, Hash) -\u003e {ok, Hash} =:= crypt:crypt(Phrase, Hash) end.\n#Fun\u003cerl_eval.13.126501267\u003e\n2\u003e Verify(\"Password\", \"$2a$05$gwtgJ3kUiZSjqwVs91/wXePGURhb0vMWeMHQKimYflWAic4o7qEHm\").\ntrue\n3\u003e Verify(\"WrongPassword\", \"$2a$05$gwtgJ3kUiZSjqwVs91/wXePGURhb0vMWeMHQKimYflWAic4o7qEHm\").\nfalse\n4\u003e Verify(\"UnixSha512Pass\", \"$6$qtweESu3ihqnZJsN$SzhUFnMe7Diz7HkO5kirxkb01ubZaxDfR4sQMMPNLea4oDfJNa5Wv4rz6QscrESyZZMBXEtnBFmPUD5eiU0NZ.\").\ntrue\n```\n\n## Exports\n\n### `crypt:gensalt`\n\n```erlang\ncrypt:gensalt(Prefix) -\u003e {ok, Salt} | {error, Reasor};\ncrypt:gensalt(Prefix, Rounds) -\u003e {ok, Salt} | {error, Reason}.\n```\n\nGenerates salt for given by `Prefix` crypt method with either default for given method number of rounds or for specified number of `Rounds`.\n\nValid prefixes (see also [crypt](https://en.wikipedia.org/wiki/Crypt_(C)#Key_derivation_functions_supported_by_crypt) on wikipedia):\n\n| Prefix  | Method |\n|---------|--------|\n| `\"\"`    | DES    |\n| `\"_\"`   | BSDi   |    \n| `\"$1$\"` | MD5    |\n| `$2a$\"`, `$2b$\"`, `$2y$` | brypt (Blowfish) |\n| `\"$3$\"` | NTHASH |\n| `\"$5$\"` | SHA-256 |\n| `\"$6$\"` | SHA-512 |\n| `\"$md5$\"` | Solaris MD5 |\n| `\"$sha1$\"` | PBKDF1 with SHA-1 |\n\nPlease note that not all methods are available on all systems.\n\n### `crypt:crypt`\n\n```erlang\ncrypt:crypt(Phrase, Salt) -\u003e {ok, Hash} | {error, Reason}.\n```\n\nReturn a hashed password `Phrase` for given `Salt`. \n\n### `crypt:change_workers_limits`\n\n```erlang\ncrypt:change_workers_limits(MinWorkers, MaxWorkers) -\u003e ok.\n```\n\nThe default crypt application configuration is `{crypt, [{min_workers, 0}, {max_workers, 16}]}.`.\n\n`MaxWorkers` controls maximum number of concurrently working port instances. \nIf all workers are busy further requests will be queued for later execution.\n\n`MinWorkers` controls minimum number of port instances which are kept alive \nawaiting for requests for immediate execution. \n\n## License\n\nThis library is licensed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplito%2Fcrypt-erl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplito%2Fcrypt-erl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplito%2Fcrypt-erl/lists"}