パッケージ、リポジトリ、アプリカテゴリを検索

password_strength_checker のカバー
パッケージ詳細v1.3.2

password_strength_checker

セキュアなパスワードを生成し、漏洩したパスワードを確認し、強度の視覚フィードバックを得るか、最小パスワード強度が必要なフォーム検証を行います。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
8460
いいね数
55
Pub ポイント
150

パッケージをインストール

flutter pub add password_strength_checker

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

セキュアなパスワードの生成、その強度の検証、およびデータ漏洩で暴露されたかどうかを確認するのに役立つFlutterパッケージです。パスワードの強度に関するリアルタイムの視覚フィードバックを提供し、カスタマイズ可能な最小強度要件を持つフォーム検証もサポートしています。堅牢な認証を必要とするアプリケーションに最適であり、複数のプラットフォームでのパスワード入力フィールドにスムーズに統合できます。

用途

  • 最小の強度を持つフォーム検証
  • リアルタイムのパスワード強度フィードバック
  • 露出したパスワードの確認
  • セキュアなパスワード生成
  • 認証フローの強化
  • クロスプラットフォームパスワードフィールド

主な機能

  • 視覚的強度インジケーター
  • 露出したパスワードの検出
  • カスタマイズ可能な強度のしきい値
  • パスワード生成ユーティリティ
  • フォームバリデータとの統合
  • マルチプラットフォーム対応

適している対象

  • 認証画面
  • ユーザー登録フォーム
  • セキュリティに焦点を当てたアプリ
  • パスワード管理ツール
  • セキュリティを最優先とする開発チーム
  • パスワードポリシーの遵守を必要とするアプリ

注意事項

  • 漏洩チェックにはインターネット接続が必要です
  • アプリのサイズがわずかに増える可能性があります
  • 露出照会に外部APIに依存しています
  • オフライン専用の環境には適していません
  • リアルタイム検証中のパフォーマンスへの影響
  • APIの障害に対する適切なエラーハンドリングが必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

password_strength_checker

License Pub Version Pub Likes Pub Points Pub Monthly Downloads GitHub code size in bytes GitHub Repo stars GitHub issues GitHub release (latest by date) GitHub top language CI

Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

Check the strength of the password in a visual way, with an animation when the strength changes according to the settings given by the user. Use it also inside a Form to get form validation!

Features

  • Check for exposed common password using the commonDictionary, a map with 10,000 leaked passwords!
  • Use the PasswordStrengthChecker to have a visual feedback.
  • Use the PasswordStrengthFormChecker to have a built-in TextFormField inside the widget and get form validation using a minimumStrengthRequired.
  • Use the PasswordGenerator class to generate a secure random password based on the input configurations (PasswordGeneratorConfiguration).
  • Create your custom strength to create your own rules or use the PasswordStrength default enum (see Custom Strength).

Demo

Demo Form Gif Demo Gif Demo Generator Gif

Getting started

PasswordStrengthChecker

You can use the PasswordStrengthChecker to only have a visual feedback, for example:

final passNotifier = ValueNotifier<PasswordStrength?>(null);
// ...
PasswordStrengthChecker(
  strength: passNotifier,
),

See the full example here.

PasswordStrengthFormChecker

You can use the PasswordStrengthFormChecker to have a built-in TextFormField inside the widget and get form validation using a minimumStrengthRequired. For example:

PasswordStrengthFormChecker(
  minimumStrengthRequired: PasswordStrength.secure,
  onChanged: (password, notifier) {
    notifier.value = PasswordStrength.calculate(text: password);
  },
),

See the full example here.

PasswordGenerator

You can use the PasswordGeneratorclass to generate a secure random password based on the configurations. For example:

final config = PasswordGeneratorConfiguration(
  length: 32,
  minUppercase: 8,
  minSpecialChars: 8,
  // ...
);

final passwordGenerator = PasswordGenerator.fromConfig(
  configuration: config,
);

final password = passwordGenerator.generate();

See the full example here.

Custom Strength

You can use the default PasswordStrength enum to set the strength of the password, or you can create your own enum that implements PasswordStrengthItem and use it. For example:

enum CustomPassStrength implements PasswordStrengthItem {
  weak,
  medium,
  strong;

  @override
  Color get statusColor => switch (this) {
      CustomPassStrength.weak => Colors.red,
      CustomPassStrength.medium => Colors.orange,
      CustomPassStrength.strong => Colors.green,
    };

  @override
  Widget? get statusWidget => switch (this) {
      CustomPassStrength.weak => const Text('Weak'),
      CustomPassStrength.medium => const Text('Medium'),
      CustomPassStrength.strong => const Text('Strong'),
    };

  @override
  double get widthPerc => switch (this) {
      CustomPassStrength.weak => 0.15,
      CustomPassStrength.medium => 0.4,
      CustomPassStrength.strong => 0.75,
    };

  static CustomPassStrength? calculate({required String text}) {
    // Implement your custom logic here
    if (text.isEmpty) {
      return null;
    }
    // Use the [commonDictionary] to see if a password
    // is in 10,000 common exposed password list.
    if (commonDictionary[text] == true) {
      return CustomPassStrength.weak;
    }
    if (text.length < 6) {
      return CustomPassStrength.weak;
    } else if (text.length < 10) {
      return CustomPassStrength.medium;
    } else {
      return CustomPassStrength.strong;
    }
  }
}

Contribution

The project is open source and you can contribute to it here -> repository link

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Contributors


Made with ❤️ from dariowskii

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト