Comments (6)
I had the same issue.
Setting the correct padding type for decryption fixed it for me:
Use ursa.RSA_PKCS1_PADDING
with key.decrypt(buf, bufEncoding, outEncoding, padding)
msg = key.decrypt(msg, 'base64', 'utf8');
becomes
msg = key.decrypt(msg, 'base64', 'utf8', ursa.RSA_PKCS1_PADDING);
from jsencrypt.
I have also experienced similar problems, the library can not support RSA_OAEP_PADDING it?
from jsencrypt.
I had the same problem. My client was an android app. I was encrypting in android and decrypting it in node using ursa. i tried ursa.RSA_PKCS1_PADDING and ursa.RSA_PKCS1_OAEP_PADDING. I tried changing the padding type in android as well which did not work. As it turned out, android was not using any padding and by default ursa was checking for padding. After going through the ursa library, I found that you can even use ursa.RSA_NO_PADDING which did the trick. Dunno if this is still useful to you. But this thread is what led me to my solution. So thanks a lot!
from jsencrypt.
no need to use ursa module anymore, just node crypto module!
from jsencrypt.
I had the same problem. How to set the padding type?
from jsencrypt.
https://www.npmjs.com/package/jsdecrypt
from jsencrypt.
Related Issues (20)
- Help regarding migrating from an older version of jsencrypt
- Security Issue HOT 1
- jsencrypt does not like node.js - or the other way around. HOT 8
- Module not found: Error: Can't resolve './JSEncrypt' in.... HOT 4
- Travis Tidwell, please show an example of decryption with openssl just like Tom Wu did HOT 3
- Are there any active maintainers? The bugs are not getting any feedback anymore HOT 3
- Module not found: Error: Can't resolve './lib/jsbn/base64' in 'C:\Users\jackdu\Documents\Project\lowcode-admin\node_modules\jsencrypt\lib' HOT 2
- Decrypted result has wrong encoding HOT 1
- window is not defined in nuxtjs v3 HOT 8
- Suggest to add judgment when string too long
- Front-end performed RSA signature on the HMAC using SHA256, but the length was incorrect, causing the server to fail to verify it.
- CVE-2012-5883
- An error occurred when using jsencrypt in a lower version of Chrome
- encryption returning false HOT 3
- Support node.js ? ReferenceError: window is not defined HOT 6
- Problem after upgrade to latest version from 3.2.1 on verify method
- Why is the result of each encryption different from the same content?
- [REQUEST] remove browser dependency ?
- Can the ciphertext length of JSENCRYPT 3.3.2 be controlled
- nest.js jsencrypt does not work with error `window is not defined`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsencrypt.