RSA key pair encryption/decryption between Ruby and JavaScript? -


i've been working on encrypts piece of data in ruby using openssl , decrypts data in javascript using javascript forge library.

the (unsecure, research only) method of distributing keys works fine, i.e., can generate keys in ruby , put them pem format, pass pem javascript , recover working key in javascript, encrypting same string using same key gives 2 different results, encoding/decoding between 2 don't work.

is there way of doing this?

the other problem passing binary data string ruby javascript without getting incompatible type error requires sort of conversion, example, converting encrypted data hex, working kind of information in forge library proving difficult.

i solved own problem, in original question

i wasn't doing right

for future reference, if using ruby openssl rsa encryption , want pass javascript, recommend using https://github.com/digitalbazaar/forge library js side,

second, convert encrypted strings hex using .unpack('h*')

forge pki library has .hextobytes() function, can use forge .decrypt method , started


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -