VB.NET - RSA in VB NET & JavaScript - not yet Demystified!

Asked By ben hobgood on 10-Oct-04 12:32 PM
Hi,
I read Peter Bromberg's article "RSA Encryption in .NET -- Demystified!" and have been able to figure out an RSA implementation for both ASP.Net and .net win apps however what I am trying to do now is implement a solution into a logon WebControl that uses VB.net to create the public/private key and client side JavaScript to encrypt with the public key.  
The concept is fairly simple:
Provide a secure method of logging on without requiring a secure protocol such as https, (preferably http).
I have written all but the JavaScript code for this system and will give anyone the code if they request it.
Here is the process:
Provide a logon form that loads a username, password, logon button and hidden input containing only the Public Key.
When an instance of the WebControl is created it writes the public/private key pair to a session variable so that it may decrypt a password upon a logon request.
Upon pressing the logon button the password is encrypted using the public key input text via a JavaScript implementation of RSA algorithm.  This encrypted value is then sent over the wire and the server then decrypts the password from the logon request using the session value then destroys the session value.
Here is a link to an open source JavaScript implementation of RSA:
http://home.zonnet.nl/MAvanEverdingen/Code/ 
The difficulty that I am facing is how to use the XML public key that is generated by .Net with this algorithm.
For any one that helps I would be happy to give all my code away for this implementation.  I will also be including code that stores and compares the passwords as hash values rather than clear text but I won't write that support in until I get the meat of this working.
Thanks,
Ben

Hi Ben !!

Asked By arnab dutta on 08-Dec-04 12:26 AM
Hi 
Could you please give me your code which does the RSA encryption in javascript as well as the decryption technique in VB.NET.I am also trying some similar things for my application and i have to solve it by any means.If u pls help me by giving the initial break thru then i would pass on to u the final result.
You can mail me with the attachment of the entire code to any of the following Email adresses.
arnabsez@gmail.com  (Prefered)
arnabkdutta@gmail.com
dutta.arnab@gmail.com
Arnab@Hriders.com
Thanks in anticipation
Arnab Dutta
(MCS Devloper)

Basic Issue Possiblity

Jason Brenton replied to ben hobgood on 22-May-08 01:24 PM

I see one thing that could cause the problem right off. different encrypters even using the same algorithm can ofet use different Key Encoding schemes. Java may be using base64 straight style, while .net may be using a proprietery custom scheme. This can be tried by using a custom parser from the byte array output, making the standrad more directly under control.

If this is not the issue, it may be a "tweak" with in standard of the algorithm that causes different structure or processing. With as special as RSA and similar algorithms are I hope not, as this means you may not be able to cross a JAVA and .net set up.

Also, if its within your experience, you can simply unify your approach. Either a Server Side Java Applet, or client side asp/vb.net