49 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
196
views
'Encrypted message length is invalid.' using node-forge to decrypt the message encrypted from jsencrypt
currently using jsencrypt and node-forge for decrypt and encrypt the message using RSA, while jsencrypt is used in frontend and node-forge in backend.
import { JSEncrypt } from 'jsencrypt'
import * as ...
0
votes
0
answers
51
views
Unable to mock JSEncrypt 3rd party library in jest
encryptPassword.js
import { JSEncrypt } from 'jsencrypt';
export const encryptPassword = (pwd, rsaPublicKey) => {
let retVal = pwd;
try {
const encrypt = new JSEncrypt();
encrypt....
2
votes
2
answers
10k
views
How do I encrypt data on react app and decrypt it in NodeJS?
I'm trying to encrypt data in my react app using RSA encryption then decrypt it on my backend. For the front end I want to use JSEencrypt, and in the backend I want to use the built-in crypto library. ...
0
votes
1
answer
159
views
Expo: RSA decrypt huge performance drop after updating from SDK 47 to 50
I was developing a mobile app with Expo 47.0.0 and debugging it with Expo Go on my iPhone 13 Pro Max. One day, my phone decided to update Expo Go, and then I was not able to run my app. I upgraded the ...
1
vote
1
answer
109
views
The fe(JS)&be(Python) coupling of RSA encryption
I am using RSA algorithm to encrypt data. The frontend uses the window.crypto and the backend uses the pycryptodome.
However, I discovered that after the frontend encrypts a payload, the backend can't ...
0
votes
1
answer
768
views
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 ...
0
votes
1
answer
482
views
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&...
0
votes
0
answers
251
views
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();
...
0
votes
0
answers
839
views
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 ...
1
vote
0
answers
2k
views
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 ...
0
votes
0
answers
656
views
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: "...
3
votes
1
answer
2k
views
Decrypt - PHPSECLIB
I'm trying to decrypt a string using phpseclib.
My hashed string is being generated from a javascript library called jsencrypt. The result of the encryption is saved in a database.
Afterwards I'm ...
2
votes
1
answer
370
views
static import works from nuxt.config.js but not from component
I have a vanilla js jsencrypt package which i needed to use in my nuxt application, the package itself works fine when imported from Nuxt.config.js but i run into issues when imported using the head ...
1
vote
2
answers
2k
views
NextJS project compilation fails with JSEncrypt
I've installed JSEncrypt npm package for asymmetric encryption.
But when I run the project I get the below error
Server Error
ReferenceError: window is not defined
I even tried to dynamically load ...
0
votes
0
answers
927
views
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 ...