Skip to content

Instantly share code, notes, and snippets.

@aiya000
Created July 19, 2019 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aiya000/58414060220c35abf4f24d5aac97f885 to your computer and use it in GitHub Desktop.
Save aiya000/58414060220c35abf4f24d5aac97f885 to your computer and use it in GitHub Desktop.
  • 前提
    • ユーザーをauthenticationにログインさせるために、authenticationへのパスワードYが必要
    • でもYは直接、僕らの手に保存したくない!
  1. ユーザーが入力したパスワードにある暗号化アルゴリズムfとsoltをかけて、パスワードXを作る
  2. firestoreにXを保存する
  3. XにfをM回かけて、パスワードYを作る
    • Xは僕らが管理するので、人間的ミスなどで漏れる可能性がある
  4. authenticationにYを登録する
    • YはGoogleが管理してくれるので、漏れない(漏れたらGoogleのせい)
  5. ! firestoreのデータが流出する = Xが流出する
  6. 攻撃者はXを使って、不正ログインしようとする
    • 「Y ≠ X」なので通らない
    • M = 1だと、「Y = f(X)」なので「とりあえずfして、試してみるか」ってやられたときに、通ってしまう
  • => Xがバレても怖くない!
  • => X & f & Mがバレると終わるけど、バレないやろ……。
@kotaro3
Copy link

kotaro3 commented Jul 19, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment