前の記事 ≪:ブロック内をiPhone画面内みたいにスクロールできるjQueryプラグイン「Re...
次の記事 ≫:jQueryベースのタブUI15種まとめ

RSA、AES暗号をJavaScriptで実現できる「cryptico.js」

2011年09月02日-はてなブックマーク

スポンサード リンク
[PR] 英単語を忘却曲線アプリを使って超効率よく記憶する方法
cryptico.js - An easy-to-use strong encryption system utilizing RSA and AES for javascript.

RSA、AES暗号をJavaScriptで実現できる「cryptico.js」
JavaScriptで複雑な暗号化アルゴリズムを簡単に実現するライブラリです。



RSAキーの生成には次のようなコードを書くだけです。

// The passphrase used to repeatably generate this RSA key.
var PassPhrase = "The Moon is a Harsh Mistress.";

// The length of the RSA key, in bits.
var Bits = 1024;

var MattsRSAkey = cryptico.generateRSAKey(PassPhrase, Bits);

この暗号化鍵を用いてテキストを暗号化します

var PlainText = "Matt, I need you to help me with my Starcraft strategy.";

var EncryptionResult = cryptico.encrypt(PlainText, MattsPublicKeyString);

クライアントサイドでブラウザ上で実現したい場合に使えますね

関連エントリ
関連の記事検索:JavaScript, 暗号, RSA, ライブラリ
スポンサード リンク

By.KJ : 2011年09月02日 10:05 livedoor Readerで購読 Twitterに投稿

間違いの指摘をしていただける方はメール、あるいはTwitter/FBでお願いします(クリック)