转:JavaScript RSA加密库Cryptico.js

   

       分类:            JavaScript            2015-02-04 13:43    1386人阅读    评论(0)    收藏    举报    

转自:http://www.open-open.com/news/view/27cfef

Cryptico.js 是一个易于使用的JavaScript工具包用于在客户端对文本进行加密。

它支持RSA + AES方法,任意字节长度(228, 1024等)的文本都可以进行加密。 Cryptico.js

内容使用一个公钥进行加密,并且只能用这个密钥进行解密。
Cryptico.js 没有依赖任何JS框架进行开发,拥有良好的文档。

1 // The passphrase used to repeatably generate this RSA key.
2 var PassPhrase = "The Moon is a Harsh Mistress.";
3
4 // The length of the RSA key, in bits.
5 var Bits = 1024;
6
7 var MattsRSAkey = cryptico.generateRSAKey(PassPhrase, Bits);
1 var PlainText = "Matt, I need you to help me with my Starcraft strategy.";
2
3 var EncryptionResult = cryptico.encrypt(PlainText, MattsPublicKeyString);


项目主页:http://cryptico.wwwtyro.net/


你可能感兴趣的:(转:JavaScript RSA加密库Cryptico.js)