Questions tagged [jsencrypt]
45 questions
1
vote
1 answer
jsencrypt returns null decrypting string from encrypt function
I am playing with jsencrypt and noticed something very strange. Here is my code. The encrypt and decrypt works if they are in a variable. But when I console log the enc and then copy the value into a string, the decryption returns null. Does…

Bill
- 512
- 4
- 14
1
vote
1 answer
Understanding JSEncrypt
I have been exploring various JavaScript libraries for RSA encryption and decryption and have came across one, JSEncrypt at https://cdnjs.cloudflare.com/ajax/libs/jsencrypt/2.3.1/jsencrypt.min.js.
However, I face great difficulty in trying to…

Kalainde V
- 55
- 1
- 9
1
vote
1 answer
Encryption-Decryption not working between the client-sever program
We are facing issue with the encryption-decryption of data.In server-side we are having decryption java code like this
public static String decrypt(byte[] data, PrivateKey base64PrivateKey) throws NoSuchPaddingException, NoSuchAlgorithmException,…

Süresh AK
- 344
- 3
- 20
1
vote
1 answer
JMeter - JsenEncrypt using Groovy so not to overload js load during each thread call for encryption
JMeter using jsr223 preprocessor wanted to use groovy as language.
How to convert present code to groovy so that below code don't cause any performance bottlenecks when executed as part of each thread
The script looks like this:

JMeter User
- 21
- 4
1
vote
3 answers
How to decrypt data using phpseclib class Crypt_RSA that was encrypted by travist/jsencrypt
im using linux ubuntu server with nginx,mysql,php7.3
I'm trying to encrypt message using public rsa key, that was generated on server side using phpseclib (http://phpseclib.sourceforge.net/)

Olympic Bear
- 15
- 6
1
vote
0 answers
Generate public key from module and exponent using JSEncrypt mismatch with java
In my js code i am trying to generate public key from modulus and exponent using JSEncrypt library.
But the generated public key is not matched with java code.
Below is my code.
this.exponent='010001';
…

Selva
- 1,620
- 3
- 33
- 63
1
vote
2 answers
python RSA encrypt differs from JSEncrypt?
I am writing a crawler using python. The website uses JSEncrypt to encrypt password. The JS code is as follows:
var pubkey =…

Borg Lin
- 123
- 1
- 9
1
vote
1 answer
Webpack change window globale object scope
I am importing the npm module JSEncrypt in my module to encrypt data. JSEncrypt has window exported global object window.Base64. I am using webpack to bundle all modules. After bundling I run the code on the browser I can write on console…

Jameel
- 2,926
- 1
- 12
- 11
0
votes
1 answer
Error 'javax.crypto.BadPaddingException: Decryption error' while trying decrypt data encrypted in the client-side with JSEncrypt
I am trying decrypt in a web application (developed with java/servlet) a token encrypted on the client-side with a javascript/JSEncrypt code.
this is the javascript code:
function submit() {
var form = document.querySelector("form");
var…

Kleber Mota
- 8,521
- 31
- 94
- 188
0
votes
1 answer
JS encrypt then decrypt it with PHP
How to do I decrypt data using PHP that I have encrypted with using JSEcrypt
Following is how I encrypted my code
async function Encrypt(form = {}) {
const JSEncrypt = (await import("jsencrypt")).default;
let encrypt = new JSEncrypt();
…

desh
- 627
- 1
- 7
- 19
0
votes
0 answers
JSEncrypt decrypt on back-end (Bash)
It looks like JSEncrypt adds some random padding to the RSA-encrypted string, and thus I cannot decrypt it with OpenSSL.
My JS code looks like this:
const rsaEncrypt = new window.JSEncrypt();
rsaEncrypt.setKey(
`-----BEGIN PUBLIC…

Aifos Si Prahs
- 343
- 1
- 9
0
votes
0 answers
How can one import a PEM private key securely in the browser with Javascript?
I have a broad question about internet security, but if you guys have any implementation tips or even broader observations, they are very appreciated as well.
The requirement I have is to perform some signature on the FE side.
They are requiring the…

arun_dev
- 11
- 1
0
votes
0 answers
How can I decrypt with my public key using JSEncrypt Or Store Private key on client browser using javascript
Case 1 : I need to encrypt data with a private key from server and decrypt it with a public key in frontend. I am using JSEncrypt and it is encrypting my data, but when I try do decrypt it, it is returning false.
var publicKeyPair1 =…

Jeebendu kumar Behera
- 113
- 1
- 13
0
votes
0 answers
JSEncrypt into Python
I'm reverse engineering a website. In website's code,
C = n("720d")
w = new C["JSEncrypt"];
w.setPublicKey(k.privateKey);
k = {
privateKey:…

Peter
- 49
- 7
0
votes
0 answers
JSEncrypt encrypt but java cannot decrypt-BadPaddingException
I'm trying encrypt data with JSEncrypt (v 2.3.1) then server decrypt data (Java).
Most of time it works, but sometime backend throw BadPaddingException.
I found on stack it may be duplicated with this question:
JSEncrypt(js) encrypt, but python…

Ca Pham Van
- 316
- 1
- 3
- 12