後でプレーンテキストで取得できるようにユーザーパスワードを保存する場合、倫理的にどうすればよいですか? 質問する

後でプレーンテキストで取得できるようにユーザーパスワードを保存する場合、倫理的にどうすればよいですか? 質問する

私が Web サイトや Web アプリケーションをどんどん構築していくと、ユーザーが問題を抱えた場合にパスワードを取得できるような方法でユーザーのパスワードを保存するよう求められることがよくあります (パスワードを忘れた場合のリンクを電子メールで送信したり、電話で手順を説明したりするなど)。私はできる限りこの慣行に反対し、実際のパスワードを保存せずにパスワードのリセットや管理支援を可能にするために、多くの「追加」プログラミングを行っています。

対抗できない場合(または勝てない場合)、私は常に何らかの方法でパスワードをエンコードして、少なくともデータベースにプレーンテキストとして保存されないようにします。ただし、DB がハッキングされた場合、犯人がパスワードを解読するのにそれほど時間はかからないことはわかっているので、不安になります。

理想的な世界では、人々は頻繁にパスワードを更新し、多くの異なるサイトでパスワードを重複させません。残念ながら、私は職場/自宅/電子メール/銀行で同じパスワードを持っている人を大勢知っています。彼らは助けが必要なときに、私にパスワードを教えてくれました。私の DB セキュリティ手順が何らかの理由で失敗した場合、彼らの経済的破滅の責任を負いたくないのです。

道徳的、倫理的に、たとえ一部のユーザーがあまり敬意を払っていなくても、一部のユーザーにとっては生活の糧となるものを保護する責任があると感じています。ソルトハッシュやさまざまなエンコードオプションについては、アプローチ方法や議論すべき点がたくさんあることは確かですが、それらを保存する必要がある場合の「ベストプラクティス」は 1 つだけでしょうか。ほとんどの場合、PHP と MySQL を使用していますが、それが具体的な処理方法に違いをもたらすかどうかはわかりません。

賞金に関する追加情報

これはあなたが望んでいることではないことは承知しており、ほとんどの場合、拒否することが最善であることを明確にしておきたいと思います。ただし、私はこのアプローチを取ることのメリットについての講義を求めているのではなく、このアプローチを取る場合に取るべき最善のステップを求めているのです。

下記のメモで、主に高齢者、知的障害者、または非常に若い人向けの Web サイトでは、安全なパスワード回復ルーチンを実行するよう求められると、ユーザーを混乱させる可能性があると指摘しました。そのような場合、それは単純で平凡なことのように思えるかもしれませんが、一部のユーザーは、サービス技術者にシステムへのログインを手伝ってもらったり、直接電子メールで受け取ったり、表示してもらったりする追加の支援を必要とします。

このようなシステムでは、ユーザーにこのレベルのアクセス支援が提供されない場合、これらの人口統計からの離脱率によってアプリケーションが妨げられる可能性があります。そのため、このような設定を念頭に置いて回答してください。

みんなありがとう

This has been a fun question with lots of debate and I have enjoyed it. In the end I selected an answer that both retains password security (I will not have to keep plain text or recoverable passwords), but also makes it possible for the user base I specified to log into a system without the major drawbacks I have found from normal password recovery.

As always there were about 5 answers that I would like to have marked as correct for different reasons, but I had to choose the best one--all the rest got a +1. Thanks everyone!

Also, thanks to everyone in the Stack community who voted for this question and/or marked it as a favorite. I take hitting 100 up votes as a compliment and hope that this discussion has helped someone else with the same concern that I had.

ベストアンサー1

How about taking another approach or angle at this problem? Ask why the password is required to be in plaintext: if it's so that the user can retrieve the password, then strictly speaking you don't really need to retrieve the password they set (they don't remember what it is anyway), you need to be able to give them a password they can use.

Think about it: if the user needs to retrieve the password, it's because they've forgotten it. In which case a new password is just as good as the old one. But, one of the drawbacks of common password reset mechanisms used today is that the generated passwords produced in a reset operation are generally a bunch of random characters, so they're difficult for the user to simply type in correctly unless they copy-n-paste. That can be a problem for less savvy computer users.

One way around that problem is to provide auto-generated passwords that are more or less natural language text. While natural language strings might not have the entropy that a string of random characters of the same length has, there's nothing that says your auto-generated password needs to have only 8 (or 10 or 12) characters. Get a high-entropy auto-generated passphrase by stringing together several random words (leave a space between them, so they're still recognizable and typeable by anyone who can read). Six random words of varying length are probably easier to type correctly and with confidence than 10 random characters, and they can have a higher entropy as well. For example, the entropy of a 10 character password drawn randomly from uppercase, lowercase, digits and 10 punctuation symbols (for a total of 72 valid symbols) would have an entropy of 61.7 bits. Using a dictionary of 7776 words (as Diceware uses) which could be randomly selected for a six word passphrase, the passphrase would have an entropy of 77.4 bits. See the Diceware FAQ for more info.

  • a passphrase with about 77 bits of entropy: "admit prose flare table acute flair"

  • a password with about 74 bits of entropy: "K:&$R^tt~qkD"

フレーズを入力する方が好みであることはわかっていますし、コピー アンド ペーストでフレーズを使用するのはパスワードと同じくらい簡単なので、損失はありません。もちろん、Web サイト (または保護されている資産) が自動生成されるパスフレーズに 77 ビットのエントロピーを必要としない場合は、生成する単語数を減らしてください (ユーザーが喜ぶことは間違いありません)。

パスワードで保護されている資産の中には、実際にはそれほど価値が高くないものもあるので、パスワードが漏洩しても世界が終わるわけではないという議論は理解できます。たとえば、さまざまな Web サイトで使用しているパスワードの 80% が漏洩したとしても、私は気にしないでしょう。漏洩したとしても、誰かがしばらくの間私の名前でスパムや投稿をするだけです。漏洩したとしても大したことではありません。しかし、私の銀行口座に侵入するわけではありません。しかし、多くの人が Web フォーラム サイトで銀行口座 (およびおそらく国家安全保障データベース) と同じパスワードを使用しているという事実を考えると、そのような「価値の低い」パスワードも回復不可能なものとして扱うのが最善だと思います。

おすすめ記事