PS3の署名に対する攻撃の話

Chaos Computer Club (CCC) により開催されたハッカー・カンファレンス 27C3 において、Bushing 氏、Marcan 氏、Sven 氏の3名により PS3 の新たな exploit が公開されました。
PS3 では ECDSA と呼ばれる電子署名アルゴリズムが用いられているそうですが、そこで private key を生成する際に用いられる本来はランダムに生成される数値が、実は固定されていることを彼らは発見したそうです。それにより容易に praivate key を見つけることができるようになったそうです。(もう見つけてる?)

カスタムなPSPBLOG: PS3の新たなHackの始まり – fail0verflow

Prominent hackers Bushing, Marcan, and Sven took the stage at this year’s annual Chaos Communication Congress (27C3) to showcase their latest underground efforts on PS3. The trio describe Sony’s security measures as an ‘epic fail,’ pointing to the botched implementation of ECDSA. Apparently, the so-called ‘random’ number used to create the private key is always static.

What does mean for you, the end-user? Well, it means that homebrew devs can essentially sign their own applications. The keys generated as every bit as valid Sony’s own official signatures. Full control means custom firmware is within grasp. What’s more, is that the feat is valid for all current firmware up to 3.55 and possibly beyond.

Hackers Describe PS3 Security As Epic Fail, Gain Unrestricted Access - eXophase.com

下の動画が攻撃者の発表。

全部版
27C3 - Console Hacking 2010 on Vimeo
スライド
27C3: Console Hacking 2010

えーと元の人も勘違いしているみたいだけど、「署名するときに使う乱数を固定できた」ので「秘密鍵を取り出せた」との説明が正しいのではないか.
ECDSAの署名アルゴリズムをざっくり書くと, メッセージをM, 秘密鍵をkとして,

  1. e = msb_n(Hash(M))
  2. mをZ_q上の乱数として, R = (mG)_x
  3. s = (e + kR)/m
  4. (R,s)を署名とする

となっている (細部は省略).

仮に乱数 m が固定されていると,

  1. 乱数を固定する
  2. メッセージM_1で署名(R_1,s_1) を得る
  3. メッセージM_2で署名(R_2,s_2) を得る
  4. m = (e_1 + k R_1)/s_1 = (e_2 + k R_2)/s_2
  5. kについて解くと, k = (s_1 e_2 - s_2 e_1) / (R_1 s_2 - R_2 s_1)

と署名を2つ得ることで秘密鍵が取り出せる. (動画の最初に出てくる数式)

Sony側が乱数固定してた」ってなってるけど本当なんですかね?

Sony側が固定してたらしい.


Clarification #3: The private keys refer to keys that Sony HQ uses. PS3s don't have these keys (but we calculated them due to the fail).

Clarification #4: the random number isn't 4, it's more like 007eabbb79360e14df1457a4194b82f71a0dc39280 (example). But it's still constant.
だそうな。

ファイル暗号化のためにAESの「秘密鍵 = private key」を作る+「秘密鍵」にSonyが署名も付けていた→署名の実装バグ→署名用の「署名鍵(秘密鍵)」が漏れる
ということなんだろうか?