码迷,mamicode.com
首页 > 编程语言 > 详细

转:JavaScript RSA加密库Cryptico.js

时间:2015-09-18 15:46:23      阅读:1118      评论:0      收藏:0      [点我收藏+]

标签:

   

       分类:            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 没有依赖任何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

标签:

原文地址:http://my.oschina.net/mellen/blog/508063

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!