Closed dumpvn closed 2 years ago
I think "dataencrypt" and "datadecrypt" samples help you.
https://github.com/kjur/jsrsasign/blob/master/sample_node/dataencrypt https://github.com/kjur/jsrsasign/blob/master/sample_node/datadecrypt
They can encrypt and decrypt any text file including AES key string with public and private key.
that is actually not the problem (and so the solution). anyway, thank you for closing the issue.
This is not an issue, but may be a feature / enhancement. (or maybe I am wrong).
one common use case is using RSA to encrypt a symmetric key. let's say I have an AES Key that need to be encrypted and send to the backend.
I can not make it work with the backend, because the backend expects the key was encrypted as 0x29, 0x7F, 0xB5...(hex to byte array) however, the
jsrsasign
library encrypted it as 0x32 0x39 0x37.... (ASCII encoding of the string). Is there anyway I can specify a string as hex encoded instead of ascii encoded?I tried to search for a solution for a day already, and I can pretty sure it is a limitation and so posting here instead of stackoverflow.
Thank you for your help!