Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Almost ! RSA Javascript/Ruby

Reply
Thread Tools

Almost ! RSA Javascript/Ruby

 
 
Jean Verger
Guest
Posts: n/a
 
      09-11-2006
Hi all,

back into the RSA Javascript/Ruby:
http://i108.photobucket.com/albums/n...er/rsaRuby.png

It looks that Javascript returns hex, while Ruby
PKey::RSA.private_decrypt(str) it takes bytes as argument. The little
documentation I found on PKey::RSA.private_decrypt, shows that it
takes string (str) as argument.

My questions:
- What kind of argument does PKey::RSA.private_decrypt(str) take ? string, byte?
- How to convert from Hex to bytes? what hex to string?
- Where can I find more documentation on PKey::RSA
- In case I decide to modify "src/ext/openssl/ossl_pkey_rsa.c" ...
should I compile that code? and store it where?

Some RSA crypt/verification hints with Ruby will be much appreciated.

thanks,

Jean

P.S.: Why almost?: I got to share the keys from the client to the
server, although I'm still not able to load the cryped pwd from the
client to the server ... but very close

http://i108.photobucket.com/albums/n...er/rsaRuby.png

On 9/5/06, Jan Svitok <(E-Mail Removed)> wrote:
> On 9/5/06, Jean Verger <(E-Mail Removed)> wrote:
> > 2. If I use this: PKey::RSA.generate(512) I believe that I still have
> > a random key generated (instead of one with n, d and e desired). From
> > not much difference than using this:
> > #openssl genrsa -out key.pem 256
> > PKey::RSA.new(File.open("/key.pem").read, nil)

>
> Sorry, I misunderstood. This is how it *could* be done. I've just read
> the sources, haven't tried.
>
> key = PKey.RSA.new
> key.n, key.e, key.d = n,e,d
>
> If you know a bit of C, read the sources of ruby, everything is there
> namely: src/ext/openssl/ossl_pkey_rsa.c
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing .net RSA on the server *and* JavaScript RSA on the client gg ASP .Net 0 11-18-2004 10:29 PM
Crypt::RSA, manual module installation alex Perl 1 06-25-2004 11:31 AM
Error using Crypt::OpenSSL::RSA - Fails loading public key - Help needed John Bergstrom Perl 0 08-03-2003 12:22 AM
Can I use PPTP-based VPN with Cisco PIX and RSA Securid? Trond Hindenes Cisco 1 07-10-2003 12:14 PM
Crypt RSA install (Problem with Crypt::Primes) AdrianK Perl 0 07-09-2003 09:32 AM



Advertisments