{"id":13792555,"url":"https://github.com/envato/zxcvbn-ruby","last_synced_at":"2026-01-02T05:41:06.851Z","repository":{"id":4703931,"uuid":"5851346","full_name":"envato/zxcvbn-ruby","owner":"envato","description":"Ruby port of Dropbox's zxcvbn javascript lib","archived":false,"fork":false,"pushed_at":"2024-03-08T06:40:34.000Z","size":1891,"stargazers_count":317,"open_issues_count":5,"forks_count":47,"subscribers_count":96,"default_branch":"master","last_synced_at":"2025-04-08T00:39:09.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/envato.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2012-09-18T04:21:59.000Z","updated_at":"2025-02-24T08:09:45.000Z","dependencies_parsed_at":"2024-08-03T22:06:45.682Z","dependency_job_id":"a4e5d6ea-c306-4cd6-852e-2fee7ee17347","html_url":"https://github.com/envato/zxcvbn-ruby","commit_stats":{"total_commits":194,"total_committers":14,"mean_commits":"13.857142857142858","dds":0.5927835051546392,"last_synced_commit":"e6a9c3eca458ae46f90825538deebb5d71c555fc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fzxcvbn-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fzxcvbn-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fzxcvbn-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envato%2Fzxcvbn-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envato","download_url":"https://codeload.github.com/envato/zxcvbn-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414455,"owners_count":22067262,"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-08-03T22:01:13.640Z","updated_at":"2026-01-02T05:41:06.846Z","avatar_url":"https://github.com/envato.png","language":"Ruby","funding_links":[],"categories":["Ruby","Gems"],"sub_categories":["Password Strength"],"readme":"# zxcvbn-ruby\n\nThis is a Ruby port of Dropbox's [zxcvbn.js][zxcvbn.js] JavaScript library.\n\n## Development status [![CI Status](https://github.com/envato/zxcvbn-ruby/workflows/CI/badge.svg)](https://github.com/envato/zxcvbn-ruby/actions?query=workflow%3ACI)\n\n`zxcvbn-ruby` is considered stable and is used in projects around [Envato][envato].\n\nAfter checking out the repository, run `bundle install` to install dependencies.\nThen, run `rake spec` to run the tests.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\nTo release a new version, update the version number in `version.rb`, and then\nrun `bundle exec rake release`, which will create a git tag for the version,\npush git commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n\n## Getting started [![Gem version](https://img.shields.io/gem/v/zxcvbn-ruby.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby) [![Gem downloads](https://img.shields.io/gem/dt/zxcvbn-ruby.svg?style=flat-square)](https://rubygems.org/gems/zxcvbn-ruby)\n\nAdd the following to your project's `Gemfile`:\n\n```ruby\ngem 'zxcvbn-ruby', require: 'zxcvbn'\n```\n\nExample usage:\n\n```ruby\n$ irb\n\u003e\u003e require 'zxcvbn'\n=\u003e true\n\u003e\u003e pp Zxcvbn.test('@lfred2004', ['alfred'])\n#\u003cZxcvbn::Score:0x00007f7f590610c8\n @calc_time=0.0055760000250302255,\n @crack_time=0.012,\n @crack_time_display=\"instant\",\n @entropy=7.895,\n @feedback=\n  #\u003cZxcvbn::Feedback:0x00007f7f59060150\n   @suggestions=\n    [\"Add another word or two. Uncommon words are better.\",\n     \"Predictable substitutions like '@' instead of 'a' don't help very much\"],\n   @warning=nil\u003e,\n @match_sequence=\n  [#\u003cZxcvbn::Match matched_word=\"alfred\", token=\"@lfred\", i=0, j=5, rank=1, pattern=\"dictionary\", dictionary_name=\"user_inputs\", l33t=true, sub={\"@\"=\u003e\"a\"}, sub_display=\"@ -\u003e a\", base_entropy=0.0, uppercase_entropy=0.0, l33t_entropy=1, entropy=1.0\u003e,\n   #\u003cZxcvbn::Match i=6, j=9, token=\"2004\", pattern=\"year\", entropy=6.894817763307944\u003e],\n @password=\"@lfred2004\",\n @score=0\u003e\n=\u003e #\u003cZxcvbn::Score:0x00007f7f59060150\u003e\n\u003e\u003e pp Zxcvbn.test('asdfghju7654rewq', ['alfred'])\n#\u003cZxcvbn::Score:0x00007f7f5a9e9248\n @calc_time=0.007504999986849725,\n @crack_time=46159.451,\n @crack_time_display=\"14 hours\",\n @entropy=29.782,\n @feedback=\n  #\u003cZxcvbn::Feedback:0x00007f7f5a9e9130\n   @suggestions=\n    [\"Add another word or two. Uncommon words are better.\",\n     \"Use a longer keyboard pattern with more turns\"],\n   @warning=\"Short keyboard patterns are easy to guess\"\u003e,\n @match_sequence=\n  [#\u003cZxcvbn::Match pattern=\"spatial\", i=0, j=15, token=\"asdfghju7654rewq\", graph=\"qwerty\", turns=5, shifted_count=0, entropy=29.7820508329166\u003e],\n @password=\"asdfghju7654rewq\",\n @score=2\u003e\n=\u003e #\u003cZxcvbn::Score:0x00007f7f5a9e9248\u003e\n```\n\n## Testing Multiple Passwords\n\nThe dictionaries used for password strength testing are loaded each request to `Zxcvbn.test`. If you you'd prefer to persist the dictionaries in memory (approx 20MB RSS) to perform lots of password tests in succession then you can use the `Zxcvbn::Tester` API:\n\n```ruby\n$ irb\n\u003e\u003e require 'zxcvbn'\n=\u003e true\n\u003e\u003e tester = Zxcvbn::Tester.new\n=\u003e #\u003cZxcvbn::Tester:0x3fe99d869aa4\u003e\n\u003e\u003e pp tester.test('@lfred2004', ['alfred'])\n#\u003cZxcvbn::Score:0x00007f7f586fcf50\n @calc_time=0.00631899997824803,\n @crack_time=0.012,\n @crack_time_display=\"instant\",\n @entropy=7.895,\n @feedback=\n  #\u003cZxcvbn::Feedback:0x00007f7f586fcac8\n   @suggestions=\n    [\"Add another word or two. Uncommon words are better.\",\n     \"Predictable substitutions like '@' instead of 'a' don't help very much\"],\n   @warning=nil\u003e,\n @match_sequence=\n  [#\u003cZxcvbn::Match matched_word=\"alfred\", token=\"@lfred\", i=0, j=5, rank=1, pattern=\"dictionary\", dictionary_name=\"user_inputs\", l33t=true, sub={\"@\"=\u003e\"a\"}, sub_display=\"@ -\u003e a\", base_entropy=0.0, uppercase_entropy=0.0, l33t_entropy=1, entropy=1.0\u003e,\n   #\u003cZxcvbn::Match i=6, j=9, token=\"2004\", pattern=\"year\", entropy=6.894817763307944\u003e],\n @password=\"@lfred2004\",\n @score=0\u003e\n=\u003e #\u003cZxcvbn::Score:0x00007f7f586fcf50\u003e\n\u003e\u003e pp tester.test('@lfred2004', ['alfred'])\n#\u003cZxcvbn::Score:0x00007f7f56d57438\n @calc_time=0.001986999996006489,\n @crack_time=0.012,\n @crack_time_display=\"instant\",\n @entropy=7.895,\n @feedback=\n  #\u003cZxcvbn::Feedback:0x00007f7f56d56bf0\n   @suggestions=\n    [\"Add another word or two. Uncommon words are better.\",\n     \"Predictable substitutions like '@' instead of 'a' don't help very much\"],\n   @warning=nil\u003e,\n @match_sequence=\n  [#\u003cZxcvbn::Match matched_word=\"alfred\", token=\"@lfred\", i=0, j=5, rank=1, pattern=\"dictionary\", dictionary_name=\"user_inputs\", l33t=true, sub={\"@\"=\u003e\"a\"}, sub_display=\"@ -\u003e a\", base_entropy=0.0, uppercase_entropy=0.0, l33t_entropy=1, entropy=1.0\u003e,\n   #\u003cZxcvbn::Match i=6, j=9, token=\"2004\", pattern=\"year\", entropy=6.894817763307944\u003e],\n @password=\"@lfred2004\",\n @score=0\u003e\n=\u003e #\u003cZxcvbn::Score:0x00007f7f56d57438\u003e\n```\n\n**Note**: Storing the entropy of an encrypted or hashed value provides\ninformation that can make cracking the value orders of magnitude easier for an\nattacker. For this reason we advise you not to store the results of\n`Zxcvbn::Tester#test`. Further reading: [A Tale of Security Gone Wrong](https://web.archive.org/web/20240715041147/http://gavinmiller.io/2016/a-tale-of-security-gone-wrong/).\n\n## Contact\n\n - [GitHub project](https://github.com/envato/zxcvbn-ruby)\n - Bug reports and feature requests are welcome via [GitHub Issues](https://github.com/envato/zxcvbn-ruby/issues)\n\n## Authors\n\n - [Steve Hodgkiss](https://github.com/stevehodgkiss)\n - [Matthieu Aussaguel](https://github.com/matthieua)\n - [_et al._](https://github.com/envato/zxcvbn-ruby/graphs/contributors)\n\n## License [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby/blob/HEAD/LICENSE.txt)\n\n`zxcvbn-ruby` uses MIT license, the same as [zxcvbn.js][zxcvbn.js] itself. See\n[`LICENSE.txt`](https://github.com/envato/zxcvbn-ruby/blob/HEAD/LICENSE.txt)\nfor details.\n\n## Code of Conduct\n\nWe welcome contribution from everyone. Read more about it in\n[`CODE_OF_CONDUCT.md`](https://github.com/envato/zxcvbn-ruby/blob/HEAD/CODE_OF_CONDUCT.md).\n\n## Contributing [![PRs welcome](https://img.shields.io/badge/PRs-welcome-orange.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby/issues)\n\nFor bug fixes, documentation changes, and features:\n\n1. [Fork it](./fork)\n1. Create your feature branch (`git checkout -b my-new-feature`)\n1. Commit your changes (`git commit -am 'Add some feature'`)\n1. Push to the branch (`git push origin my-new-feature`)\n1. Create a new Pull Request\n\nFor larger new features: Do everything as above, but first also make contact with the project maintainers to be sure your change fits with the project direction and you won't be wasting effort going in the wrong direction.\n\n## About [![code with heart by Envato](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-Envato-ff69b4.svg?style=flat-square)](https://github.com/envato/zxcvbn-ruby)\n\nThis project is maintained by the Envato engineering team and funded by [Envato][envato].\n\nEncouraging the use and creation of open source software is one of the ways we\nserve our community. Perhaps [come work with us][careers]\nwhere you'll find an incredibly diverse, intelligent and capable group of people\nwho help make our company succeed and make our workplace fun, friendly and\nhappy.\n\n [careers]: https://envato.com/careers/?utm_source=github\n [envato]: https://envato.com?utm_source=github\n [zxcvbn.js]: https://github.com/dropbox/zxcvbn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvato%2Fzxcvbn-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvato%2Fzxcvbn-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvato%2Fzxcvbn-ruby/lists"}