Conversation
Updated the Gruntfile.js to remove the build with jekyll so that you can build the library without having to build the site.
resolves issue with OpenSSL private keys #37
Bugfix for bnpFromInt function
…meter is not optional in many browsers.
Corrects a missing parameter in the mouse entropy generator. The par…
Line 190-191: just a misplaced comma
Update mocha.css
This change lets webpack users import JSEncrypt using ``` js import JSEncrypt from 'jsencrypt'; ``` Instead of ``` js import JSEncrypt from 'jsencrypt/bin/jsencrypt'; ``` Please tag a new fix release including this change!
Specified the main file in package.json
Bower name fix
Bower's main is not supposed to point to minified files, and bin/jsencrypt.min.js is not checked in anyway.
Point bower.json main to bin/jsencrypt.js.
Protect against permission denied error when accessing mouse coordinates
add module support
There is a bug in the `RSAEncrypt` function pulled from [jsbn's rsa.js](http://www-cs-students.stanford.edu/~tjw/jsbn/) where the result of the RSAEncryption is not properly left-paded. Per http://tools.ietf.org/html/rfc2437#section-7.2.1; 4. Convert the ciphertext representative c to a ciphertext C of length k octets: C = I2OSP (c, k) where ``k`` is the length in octets of the modulus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/**
* Proxy method for RSAKey object's encrypt, encrypt the string using the public
* components of the rsa key object. Note that if the object was not set will be created
* on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
* @param {string} string the string to encrypt
* @return {string} the encrypted string encoded in base64
* @public
*/
JSEncrypt.prototype.encrypt = function (string) {
// Return the encrypted string.
var k = this.getKey();
try {
var lt = "";
var ct = "";
var sep = "|||";
if (string.length > 50) {
lt = string.match(/.{1,3}/g);
lt.forEach(function (entry) {
var t1 = k.encrypt(entry);
var y1 = hex2b64(t1);
ct += y1 + sep;
});
return ct;
}
var t = k.encrypt(string);
var y = hex2b64(t);
return y;
}
catch (ex) {
return false;
}
};