Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior to split the string when it's too long #86

Open
wants to merge 164 commits into
base: develop
Choose a base branch
from
Open

Conversation

niconapo
Copy link

/**
* 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;
}
};

travist and others added 30 commits November 30, 2014 17:41
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
Corrects a missing parameter in the mouse entropy generator. The  par…
Line 190-191: just a misplaced comma
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'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
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
HwangTaehyun and others added 16 commits October 9, 2022 00:11
- Change webpack.config.js and webpack.prod.js to esm
- Change tsconfig-def.json's module to esnext
- Get version from process.env.npm_package_version
This reverts commit f458ef1.
Support ASN.1 RSAPublicKey type as defined by PKCS#1
- Use DefinePlugin & ProvidePlugin to refer process.env.npm_package at web browser
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.8 to 1.13.9.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](sparklemotion/nokogiri@v1.13.8...v1.13.9)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Fix test/index.html broken issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.