2017-03-06 10 views
1

私は、そのパスワードをプレーンテキストやハッシュのパスワードで保存しなくても、ユーザーの認証方法を知りたいと思っています。ハッシュのないパスワードを安全に保存するには?

どうすればよいですか?

ユーザーキーが暗号化できる制御文字列を保持し、それを格納した暗号化文字列と比較するのは安全ですか?

+0

"パスワードをプレーンテキストまたはハッシュで保存する必要はありません" - なぜですか? – mayersdesign

+0

セキュリティ上の理由 – jm8FE

+1

ハッシュの仕組みはどうですか? –

答えて

1

毎のNIST(アメリカ国立標準技術研究所):

、ハッシュ関数を使用しておよそ100msの期間中にランダム塩でHMACを反復処理し、ハッシュと塩を保存します。 PBKDF2,password_hash,Bcryptなどの機能を使用してください。要点は、攻撃者が無差別にパスワードを見つけるのに多くの時間を費やすことです。

参照:NIST SP 800-63-3ドラフト文書「デジタル認証ガイドライン」

ドに基づいジム・フェントン 情報によって「より良いパスワードの要件に向けて」のプレゼンテーションから抜粋How to store your users’ passwords safely

Require an 8 character min, >64 max with no truncation or 6 random digits 
Use a dictionary to disallow common passwords against a dictionary list of 10M compromised passwords 
Allow all printing characters (Unicode optional) + spaces but MAY canonicalize spaces out 
Best to accept Unicode, including emojis (1 “character”/code point) 
Limit failed authentication attempts to 100 in 30-day period per account 
Offer option to display the secret while typing rather than dots or asterisks 

Storing passwords: 
    Hash with 32-bit random salt using key derivation function such as 
    PBKDF2 with SHA-1, SHA-2 family, SHA-3 family 
    with at least 10,000 iterations 

ドン」 T:

Require composition rules 
Allow hints 
Require routine password expiration 
Save plain or hashed versions with or without seeding 

参照:ジム・フェントンによってToward Better Password Requirements

1

あなたがしなければならないことについてのZaphの回答を参照してください。役に立つと思うように、少しだけ背景を追加します。

暗号化された形式でパスワードを保存することは、適切に行われたパスワードハッシュを保存することより安全性が低くなります。これは、暗号鍵が正しい鍵で暗号化されていないように設計されているためであり、暗号アルゴリズムはブルートフォース攻撃に対する防御の1つとして遅くなることに必ずしも依存しないからです。

しかし、適切に行われたパスワードハッシュアルゴリズムは、ハッシュからパスワードを取得できないように設計されています。パスワードハッシングアルゴリズムの設計では、ハッシュの速度を使用しますすべての可能なパスワードを無差別にハッシュしてパスワードを見つけてください。

関連する問題