Experiments with RSA encryption

This commit is contained in:
RainLoop Team 2014-07-25 02:28:10 +04:00
parent bbcbfdc150
commit 777d014403
36 changed files with 2272 additions and 7995 deletions

19
vendors/jsbn/_fix.js vendored Normal file
View file

@ -0,0 +1,19 @@
function RSAEncryptLong(text) {
var length = ((this.n.bitLength()+7)>>3) - 11;
if (length <= 0) return false;
var ret = "";
var i = 0;
while(i + length < text.length) {
ret += this._short_encrypt(text.substring(i,i+length));
i += length;
}
ret += this._short_encrypt(text.substring(i,text.length));
return ret;
}
RSAKey.prototype._short_encrypt = RSAEncrypt;
RSAKey.prototype.encrypt = RSAEncryptLong;
window['RSAKey'] = RSAKey;