RSA Private / Public Key Encryption in JS

1,848 views
Skip to first unread message

Benjamin Wanicur

unread,
Apr 9, 2013, 3:26:16 PM4/9/13
to sandi...@googlegroups.com
Hi Everyone

I've had a tough time finding a JS library that can handle the following scenario:

- The server is in possession of the private RSA key.
- The client side JS is in possession of the public RSA key.

The client should encrypt plain text using the public RSA key.  The server should decrypt the text using the private RSA key.  

I've seen a few libraries that seem to handle RSA encryption completely within a JS environment.  In my case the key pair has been generated by the server.  I'm using the standard Ruby Open::SSL library on the server.  Loading the public key into a JS string does not seem to work in the libraries I have tested.

Can someone recommend a library that would handle this scenario ?

Thanks

Ben W

Jarrod Overson

unread,
Apr 9, 2013, 4:24:37 PM4/9/13
to sandi...@googlegroups.com
Never dealt with that before. There are node options (https://encrypted.google.com/search?q=rsa&q=site:npmjs.org) but many likely rely on local compiled libraries.

What are you doing, security wise, that can't be achieved by using SSL?

--
Jarrod Overson


--
You received this message because you are subscribed to the Google Groups "San Diego JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sandiegojs+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jarrod Overson 
tw | gh | g+ | li

Joe Crawford

unread,
Apr 9, 2013, 4:49:51 PM4/9/13
to sandi...@googlegroups.com
What libraries have you tested?

This looks promising.

Is there a sample key that can be tested with?

Joe
On Tue, Apr 9, 2013 at 12:26 PM, Benjamin Wanicur <bwan...@gmail.com> wrote:

Ben Wanicur

unread,
Apr 9, 2013, 4:55:29 PM4/9/13
to sandi...@googlegroups.com
I've recently tried out this one:


However, my co-worker has tried several others in the past.  I was just hoping someone out there might have the gold standard.  I'm beginning to suspect that does not exist (yet) in the JS library world.


--

Joe Crawford

unread,
Apr 9, 2013, 5:11:46 PM4/9/13
to sandi...@googlegroups.com
On Tue, Apr 9, 2013 at 1:55 PM, Ben Wanicur <bwan...@gmail.com> wrote:
I've recently tried out this one:


However, my co-worker has tried several others in the past.  I was just hoping someone out there might have the gold standard.  I'm beginning to suspect that does not exist (yet) in the JS library world.

Reply all
Reply to author
Forward
0 new messages