{"id":46576608,"url":"https://github.com/dhruvanbhalara/password_engine","last_synced_at":"2026-03-07T10:03:12.671Z","repository":{"id":279409680,"uuid":"938712257","full_name":"dhruvanbhalara/password_engine","owner":"dhruvanbhalara","description":"A Flutter package that provides a robust and customizable password generator with an enhanced set of features. This package helps you create secure passwords with a user-friendly interface and extensive customization options.","archived":false,"fork":false,"pushed_at":"2026-03-01T13:22:02.000Z","size":470,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-01T13:23:38.951Z","etag":null,"topics":["password","passwordgenerator","strongpasswordcreator"],"latest_commit_sha":null,"homepage":"https://passwordengine.netlify.app","language":"Dart","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/dhruvanbhalara.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-25T11:38:31.000Z","updated_at":"2026-03-01T13:22:03.000Z","dependencies_parsed_at":"2025-12-22T02:02:41.929Z","dependency_job_id":null,"html_url":"https://github.com/dhruvanbhalara/password_engine","commit_stats":null,"previous_names":["dhruvanbhalara/password_generator_extended","dhruvanbhalara/password_engine"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dhruvanbhalara/password_engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvanbhalara%2Fpassword_engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvanbhalara%2Fpassword_engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvanbhalara%2Fpassword_engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvanbhalara%2Fpassword_engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhruvanbhalara","download_url":"https://codeload.github.com/dhruvanbhalara/password_engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvanbhalara%2Fpassword_engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["password","passwordgenerator","strongpasswordcreator"],"created_at":"2026-03-07T10:03:07.344Z","updated_at":"2026-03-07T10:03:07.940Z","avatar_url":"https://github.com/dhruvanbhalara.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Password Engine\r\n\r\nA secure, modular, and extensible password generation library for Dart and Flutter.\r\n\r\n## Features\r\n\r\n- **Cryptographically Secure**: Uses `Random.secure()` for strong random number generation.\r\n- **Modular Design**: Built with interfaces (`IPasswordGenerationStrategy`, `IPasswordStrengthEstimator`) for maximum flexibility.\r\n- **Customizable**:\r\n  - Configure length, character sets, and exclusion of ambiguous characters.\r\n  - Inject custom generation strategies.\r\n  - Inject custom strength estimators.\r\n- **Extensible**: Easily add new strategies (e.g., memorable words, PINs) without modifying the core library.\r\n- **Normalizer**: Pluggable `IPasswordNormalizer` interface — inject a custom normalizer for Unicode normalization or whitespace handling.\r\n- **Validation**: Enforce minimum character counts (e.g., \"must have 2 symbols\") via `ConfigAwarePasswordValidator`.\r\n- **Feedback**: Evaluate password strength with user-friendly feedback via `estimateFeedback()`.\r\n- **Customizable Messages**: Feedback and error strings are generated from a YAML source and can be updated centrally.\r\n\r\n## Getting Started\r\n\r\nAdd the package to your `pubspec.yaml`:\r\n\r\n```yaml\r\ndependencies:\r\n  password_engine: ^1.0.0\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\n```dart\r\nimport 'package:password_engine/password_engine.dart';\r\n\r\nvoid main() {\r\n  // Create a generator with default settings (RandomPasswordStrategy)\r\n  final generator = PasswordGenerator();\r\n\r\n  // Generate a password\r\n  String password = generator.generatePassword(); \r\n  print(password); // e.g., \"aB3$kL9@pQ2!\"\r\n}\r\n```\r\n\r\n### Custom Configuration\r\n\r\nUse the fluent `PasswordGeneratorConfigBuilder` to create robust configs:\r\n\r\n```dart\r\nfinal config = PasswordGeneratorConfig.builder()\r\n  .length(20)\r\n  .useUpperCase(true)\r\n  .useLowerCase(true)\r\n  .useNumbers(true)\r\n  .useSpecialChars(true)\r\n  .excludeAmbiguousChars(true) // e.g., excludes 'I', 'l', '1', 'O', '0'\r\n  .build();\r\n\r\nfinal generator = PasswordGenerator();\r\ngenerator.updateConfig(config);\r\nString password = generator.generatePassword();\r\n```\r\n\r\n### Using Custom Strategies\r\n\r\nThe library supports custom generation strategies. You can implement `IPasswordGenerationStrategy` to create your own.\r\n\r\n**Note**: The `MemorablePasswordStrategy` and `PronounceablePasswordStrategy` have been moved to the `example` app to serve as learning resources. You can copy them into your project if needed.\r\n\r\n```dart\r\n// Example of using a custom strategy (e.g., from the example app)\r\nfinal memorableStrategy = MemorablePasswordStrategy(separator: '-');\r\nfinal generator = PasswordGenerator(generationStrategy: memorableStrategy);\r\n\r\ngenerator.updateConfig(PasswordGeneratorConfig(length: 4)); // 4 words\r\nString password = generator.generatePassword(); // e.g., \"correct-horse-battery-staple\"\r\n```\r\n\r\n### Password Strength Estimation\r\n\r\nThe library includes a default entropy-based strength estimator, but you can inject your own (e.g., one based on zxcvbn).\r\n\r\n```dart\r\nclass MyCustomStrengthEstimator implements IPasswordStrengthEstimator {\r\n  @override\r\n  PasswordStrength estimatePasswordStrength(String password) {\r\n    // Your custom logic here\r\n    return PasswordStrength.strong;\r\n  }\r\n}\r\n\r\nfinal generator = PasswordGenerator(\r\n  strengthEstimator: MyCustomStrengthEstimator(),\r\n);\r\n\r\nPasswordStrength strength = generator.estimateStrength(\"myPassword123\");\r\n```\r\n\r\n### Password Feedback\r\n\r\nEvaluate a password and receive user-facing feedback including strength, warnings, and suggestions:\r\n\r\n```dart\r\nfinal generator = PasswordGenerator();\r\n\r\nfinal feedback = generator.estimateFeedback('myPassword');\r\nprint(feedback.strength.name);    // \"veryWeak\"\r\nprint(feedback.warning);          // \"Weak password\"\r\nprint(feedback.suggestions);      // [\"Increase length to at least 16\", ...]\r\n```\r\n\r\n### Customizing Messages\r\n\r\nFeedback and error messages are generated from a YAML source file:\r\n\r\n- Source: `lib/l10n/messages.i18n.yaml`\r\n- Generated output: `lib/l10n/messages.i18n.dart`\r\n\r\nThis is a single-locale (English) message system. To customize messages, edit the YAML and re-run build_runner:\r\n\r\n```bash\r\ndart run build_runner build\r\n```\r\n\r\n## Configuration Options\r\n\r\n| Parameter               | Type | Default | Description                                      |\r\n| ----------------------- | ---- | ------- | ------------------------------------------------ |\r\n| `length`                | int  | 16      | Password length (or word count for some strategies) |\r\n| `useUpperCase`          | bool | true    | Include uppercase letters                        |\r\n| `useLowerCase`          | bool | true    | Include lowercase letters                        |\r\n| `useNumbers`            | bool | true    | Include numbers                                  |\r\n| `useSpecialChars`       | bool | true    | Include special characters                       |\r\n| `excludeAmbiguousChars` | bool | false   | Exclude characters like 'I', 'l', '1', 'O', '0'  |\r\n| `extra`                 | Map  | {}      | Custom parameters for user-defined strategies    |\r\n\r\n## Security Notes\r\n\r\n- **CSPRNG**: Uses `Random.secure()` for all random number generation.\r\n- **Normalizer**: The default normalizer is a passthrough. Inject a custom `IPasswordNormalizer` for Unicode normalization or whitespace handling if your application requires it.\r\n- **Validation Threshold**: The default `PasswordValidator` enforces strictly 16+ characters and requires a mix of 4 character types.\r\n- **Entropy**: The default strength estimator uses pool-based entropy (`L × log₂(N)`). This assumes uniform random selection and may overestimate strength for pattern-enforced passwords. Inject a custom `IPasswordStrengthEstimator` (e.g., zxcvbn-based) for more accurate estimations.\r\n\r\n## Additional Information\r\n\r\n- **Source Code**: [GitHub Repository](https://github.com/dhruvanbhalara/password_engine)\r\n- **Issues**: [Issue Tracker](https://github.com/dhruvanbhalara/password_engine/issues)\r\n- **Examples**: Check the `example` folder for a full Flutter app demonstrating custom strategies and UI integration.\r\n\r\n## License\r\n\r\nMIT License - see the [LICENSE](LICENSE) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvanbhalara%2Fpassword_engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhruvanbhalara%2Fpassword_engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvanbhalara%2Fpassword_engine/lists"}