前回出来なかったって書いたけど、tlslite使って出来た。
これでWSSE、OAuth(RSA-SHA1)、OAuth(HMAC-SHA1)の認証が出来るようになった。
G-Storage
http://g-storage.appspot.com/
RSAの計算
RSAを使って、やたら面白い事をやってる方がいた。
RSA暗号で「ふっかつのじゅもん」を作る(1) - Pashango’s Blog
http://d.hatena.ne.jp/pashango_p/20090706/1246897957
Pythonは関数が便利だったりintが勝手にfloatにならなかったり。
挙動を1番知ってるPHPに書き換えてみた。
<?php // 最大公約数を求める function gcd($a, $b) { while ($b!=0) { list($a, $b) = array($b, $a % $b); } return $a; } // 最小公倍数を求める function lcm($a, $b) { return $a * $b / gcd($a, $b); } // 拡張ユークリッド互除法 function gcd2($a, $b) { if ($b==0) { $u = 1; $v = 0; } else { $q = (int)($a / $b); $r = $a % $b; list($u0, $v0) = gcd2($b, $r); $u = $v0; $v = $u0 - $q * $v0; } return array($u, $v); } // べき剰余 function pow2($b, $e, $m) { $result = 1; while (0<$e) { if (($e & 1) == 1) { $result = ($result * $b) % $m; } $e >>= 1; $b = ($b * $b) % $m; } return $result; }
リンク
OpenSSLとか使わないで自力で計算してるプログラムを探してみた。
RSA暗号で「ふっかつのじゅもん」を作る(1) - Pashango’s Blog
http://d.hatena.ne.jp/pashango_p/20090706/1246897957
RSA暗号計算(Ushiro Yasunori)
http://www.cs.t-kougei.ac.jp/nsim/study/RSA.htm
暗号化のお話 (2)
http://x68000.q-e-d.net/~68user/net/crypt-2.html
RSA の計算例
http://www.gbb60166.jp/cipher/example.htm
RSA暗号体験入門 (目次)
http://www.cybersyndrome.net/rsa/
RSA暗号 - Security Akademeia
http://akademeia.info/index.php?RSA%B0%C5%B9%E6
はやわかり RSA
http://pgp.iijlab.net/crypt/rsa.html
RSA暗号化アルゴリズムの証明
http://www12.plala.or.jp/dokugaku/algo/rsa.html
RSA暗号を実装してみよう!
http://www.greg.jp/~greg/technical/ImplementingRSA.html
RSA暗号の公開鍵と秘密鍵を生成する: プログラマーになりたい!
http://www-section.cocolog-nifty.com/blog/2008/02/rsa_2dbf.html
RSA
http://www.ep.u-tokai.ac.jp/~kikn/Java2004/text-RSA.html
RSA暗号
http://herb.h.kobe-u.ac.jp/RSA.html
バイナリ法
http://www12.plala.or.jp/dokugaku/algo/encode.html
算術算法研究-RSA暗号
http://matsumoto-lab.hp.infoseek.co.jp/chapter04/intro.html