26 questions
0
votes
0
answers
87
views
RSA with nodejs and flutter Error during decryption (probably incorrect key). Original error: Error: error:02000079:rsa routines::oaep decoding error
I am experimenting with developing rsa with flutter and nodejs. public.pem and private.pem are same for both. Both the code are working fine when run in same language. but when transmitting data over ...
0
votes
1
answer
103
views
node-rsa fails to decrypt
On the client side,
import JSEncrypt from 'jsencrypt';
var cryptor = new JSEncrypt();
const publicEncrypt = (str:string, publicKey:string = PUBLIC_KEY) =>{
cryptor.setPublicKey(publicKey);
...
0
votes
0
answers
124
views
The same set of public and private key encrypted text produces different types of variables?
function encrypt(encrypted, publicKey) {
const encrypt = crypto.publicEncrypt(publicKey, Buffer.from(encrypted));
return encrypt;
}
var ciphertext = this.encrypt("***",key.exportKey(...
0
votes
2
answers
1k
views
Convert jwk to pem in nest.js
I have this jwk key that I wanto convert into pem:
const jwkey = {
kty: 'RSA',
kid: 'eecb0ced-4d49-4100-9547-841e4100b756',
n: '...very long string',
e: 'AQAB',
alg: 'RS256',
use: 'sig',
};...
0
votes
0
answers
402
views
No inverse error during encryption (node-rsa)
I am trying to convert https://clover.app.box.com/s/rz18bni3bpmdrc8wc92xm4w8h9grrtty from Java to node.js
I am using the node-rsa package and getting error:0306E06C:bignum routines:BN_mod_inverse:no ...
1
vote
0
answers
814
views
Node-RSA decryption very slow in React Native
I tried to decrypt a string encrypted with a publicKey on the server using Node-RSA in my React Native app with the privateKey using the same Node-RSA lib, it takes about 2-3 secs to decrypt a simple ...
0
votes
0
answers
1k
views
RSA encryption text/message using our PublicKey - JavaScript or ReactJS
What I have to do is encrypt a small message through a public key. I have the public key but I can't encrypt any messages.
I have tried with JSEncrypt, encrypt-rsa, hybrid-crypto-js, NodeRSA and ...
1
vote
1
answer
2k
views
Node-rsa isn't working in react native. But, I've to use it for decryption in Mobile application
So, I'm developing a project which needs a website to generate the qr code with encryption and qr code scanner mobile application to scan and decrypt the qr code.
I've used node-rsa for encryption in ...
0
votes
0
answers
180
views
C++ Openssl and node-rsa compatible?
I want to decrypt my C++ Openssl RSA message with node-rsa.
In node-rsa I get
Error: Error during decryption (probably incorrect key). Original error: Error: Incorrect data or key
Encryption:
//ADD ...
0
votes
0
answers
329
views
How do I encrypt/decrypt Json Array using node-rsa backend: NodeJS and frontEnd: Angular
I am using node-rsa library in both NodeJS and Angular.
node-rsa: https://www.npmjs.com/package/node-rsa
I am trying to encrypt a JSON Array from nodeJS server to be sent Angular where it has to ...
1
vote
1
answer
961
views
Buffer library in browser does not return the same value as in nodejs
When running the Buffer.from static method in node js on a public key I get different console.log when running it from the browser (in an angular project). Should'nt they be the same? Is there ...
0
votes
1
answer
7k
views
How to import buffer library in a frontend ionic angular project for node-rsa to work
I need to use node-rsa to encrypt a wifi-password in ionic 5 with angular.
I have a running example on Stackblitz.
However when i replicate it locally in angular 10 as well as ionic 5, it doesn't work....
1
vote
0
answers
639
views
Node.js - node-rsa - Error during encryption. Original error: Error: error:0306E06C:bignum routines:BN_mod_inverse:no inverse
I`m trying to encrypt data via RSA using public key (128-bytes == 1024-bits) received from auth server.
Here is a code in Node.js:
const NodeRSA = require('node-rsa');
const openData = Buffer.from('...
2
votes
1
answer
6k
views
Node-rsa Encrypting Public key from the pem file and trying to decrypt, but getting following error. (probably incorrect key) NODEJS
Error: Error during decryption (probably incorrect key). Original error: Error: This is not private key
Here is my nodejs code. I am using node-rsa.
const keyData = fs
.readFileSync("./docs/...
0
votes
3
answers
3k
views
Unable to correctly encrypt data using RSA/ECB/PKCS1 in nodejs
Im using the node-rsa package for encrypting data as follows
const crypto = require('crypto')
const NodeRSA = require('node-rsa')
const path = require("path")
const fs = require("fs")
const ...
0
votes
1
answer
309
views
Should I use a public key or private key to generate modulus and exponent for a JWKS endpoint?
I tried searching for an answer to this question and didn't find anything. So, I'm asking and answering.
I'm trying to implement a JWKS endpoint. I found some example code here. Note that the author'...
0
votes
0
answers
791
views
Cannot decrypt C# encrypted message using node-rsa npm
I've got a server written in node.js that I want to receive encrypted messages from a C# app. I tried to implement RSA firstly for this task, but with no avail, because I wasn't able to decrypt the ...
1
vote
2
answers
10k
views
How do I decrypt a file using node-rsa with public and private keys?
I was following this tutorial on medium. However the tutorial does not explain how to decrypt the encrypted file. Nor does it explain how the public / private keys are used.
Simply running decrypt ...
1
vote
1
answer
5k
views
Verifying a RSA signature with nodejs (signed with phpseclib)
I am trying to integrate a payment gateway to my nodejs app. When the payment is complete, the gateway redirects the user to my site with the payment result. The result is RSA signed and I need to ...
12
votes
1
answer
4k
views
RSA sign in node.js and verify in C++
I'm working on a way to secure the message I sent from a node.js server to a C++ application.
From node.js , I created a key pair.
I'm using node-rsa to read the public key on node.js side ( https:...
2
votes
2
answers
7k
views
Signing/Decoding with Base-64 PKCS-8 in Node.js
Currently working to try to get connected with the Walmart Partners API, and having some issues with their cryptography, and I have not found any documented assistance for this in Javascript/Node.
...
3
votes
1
answer
1k
views
Typescript compilation for module imports
I am working with an npm module (node-rsa), trying to use typescript. In the example for my module, I need to write some js like this (taken from the module docs).
var NodeRSA = require('node-rsa');
...
7
votes
3
answers
19k
views
node-rsa errors when trying to decrypt message with private key
So I've been trying to use node with node-rsa and javascript with jsencrypt to create a website (for an assignment) where the javascript client gets the public key generated by the server (node-rsa), ...
1
vote
1
answer
852
views
node-rsa decryption doesn't work
I tried to implement rsa public key system.
the server was implemented with node-js and using node-rsa library to encrypt/decrypt rsa.
and the client was implemented with java.
in authentification ...
5
votes
1
answer
3k
views
node-rsa and openssl compatibility
I have a set of public/private keys, that works flawless when encrypting/decrypting some data using only one of the 2 ways for both encryption and decryption.
I still have no luck trying to encrypt ...
3
votes
3
answers
9k
views
node-rsa : InvalidAsn1Error: encoding too long
I am using node-rsa module for decrypt the key .
I have created one private key from p12 file by using below command
openssl pkcs12 -in xxx.p12 -nocerts -out privateKeyPkcs12.pem
it has given rsa ...