-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Message too long for RSA #110
Comments
Public Key Encryption can only handle small amounts of data related to the size of the key being used. For larger amounts of data you need to use a hybrid approach. |
@afinal I created a library as a wrapper that helps does encryption and decryption of RSA public-private keypairs natively in Javascript around 5 months ago, you can check it out here: https://github.com/joshuaquek/QuickEncrypt |
Is there a library that encrypts larger amounts of data and runs in the browser? Thanks a lot! |
I think you should use encryptLong |
this is my working code , copy from others |
You can try the following code
|
I have the same issue in react-native app but I tried to use this package instead of jsencrypt. it works for me @lsqswl/rsaencrypt |
let encrypt = new JSEncrypt(); encrypt.setPublicKey(PUBLIC_KEY); let RequestData = encrypt.encrypt(JSON.stringify({method, data}));
The text was updated successfully, but these errors were encountered: