3

ユーザーが入力したパスワードのパスワード強度を伝える Android アプリケーションを開発することを考えています。

パスワードの強度を確認するという点では、これら2 つのアルゴリズムを開発して確認しました。しかし、効率的ではないと思うので、これらのアルゴリズムを使用することを考え直しています。皆さんはどう思いますか?

ここに私の2つのアルゴリズムがあります:

平均法

Sample input = Password12@

1. Count the lowercase, uppercase, digits and special characters in the given String.
   Eg.
   Lowercase count = 7;
   Uppercase count = 1;
   Digits count = 2;
   SpecialCharacter count = 1;

2. Get the character count and multiply it to the size of given String.
   Eg.
    (Count * Size)
    (7 * 10) = 70
    (1 * 10) = 10
    (2 * 10) = 20
    (1 * 10) = 10

3. Add the following results
   Eg.
    70 + 10 + 20 + 10 = 110

4. Get the results which is the password strength.
   Eg.
    The password is 110% strong.

ポイント方式

Sample input = Password12@

1. Set the points such that for every:
    Lowercase = 1 point given
    Uppercase = 5 points given
    Digits = 10 points given
    Special Character = 15 points given

2. Count the lowercase, uppercase, digits and special characters in the given String.
   Eg.
   Lowercase count = 7;
   Uppercase count = 1;
   Digits count = 2;
   SpecialCharacter count = 1;

3. Get the character count and add it to the given point and multiply the size of the given String.
   Eg.
    (Count + Point) * size
    (7 + 1) * 10 = 80;
    (1 + 5) * 10 = 60;
    (2 + 10) * 10 = 120;
    (1 + 15) * 10 = 160;

4. Add the following results and divide it to the size of given String and divide it by 4.
   Eg.
    //4 because count={uppercase, lowercase, digits, special character}
    80 + 60 + 120 + 160 = 420
    420 / 4 = 105

5. Get the result which is the pswword strength.
   Eg.
   The password strength is 105%.

私の質問は次のとおりです。

  • 実装が優れていることを示したアルゴリズムはどれですか?

  • 指定された 2 つのアルゴリズムが非効率的である場合、指定されたパスワードの強度を確認するために使用できる既存のアルゴリズムはありますか。このようなものではなく、車輪の再発明です。

4

2 に答える 2

1

どちらのアルゴリズムにも、パスワードの強度をチェックする際に固有の問題がいくつかあります。

最初のアルゴリズムは基本的に、パスワードの長さを数えて 10 を掛けるだけです。このアルゴリズムを使用すると、パスワード「passwordpassword」の評価は 160% になります。このような単純なパスワードには強すぎます。

2 番目のアルゴリズムはもう少し複雑で、文字の種類に基づいて重みを使用します。ただし、このアルゴリズムを使用すると、パスワード「1234」の評価は 100% になります。これはあなたが望むものではないと確信しています。

一般的な経験則は、ルールのリストに基づいてパスワードの強度をテストし、それらのルールに重み付けすることです (パスワードによって実際に適用されるルールの数と共に)。

  • パスワードは 8 文字以上である必要があります (10 ポイント)
  • パスワードには少なくとも小文字が含まれている必要があります (5 ポイント)
  • パスワードには少なくとも大文字が含まれている必要があります (5 ポイント)
  • パスワードには少なくとも 1 つの数字 (5 ポイント) が含まれている必要があります
  • パスワードには少なくとも記号が含まれている必要があります (10 ポイント)
  • パスワードには少なくとも 5 つの一意の文字 (5 ポイント) が含まれている必要があります

次に、適用されるルールを一緒に追加し、その数に、適用されるルールの数に重みを掛けた値を掛けることができます。例えば:

"1234" = (5) + 1*10 = 15

「パスワード」= (5+5) + 2*10 = 30

"password1" = (5+5+5) + 3*10 = 45

"password1234" = (5+5+5+10) + 4*10 = 65

"Password1234" = (5+5+5+5+10) + 5*10 = 80

"Passw@rd1234" = (5+5+5+5+10+10) + 6*10 = 100

これは、ルール ベースのアプローチがどのように機能するかを簡単に説明したものです。個人的には、代わりに指数関数的に使用されるルールの数を重み付けし、多種多様なルールを用意します。基本的に、より多くのルールが満たされているほど、パスワードはより複雑になり、より安全になります。

于 2015-09-07T13:52:30.730 に答える