How to realize encrpytion string with RSA method?

I have a string password,I want to encrpyt password before keeping it in database,I don't konw how to realize RSA encrpytion method and how to encrpytion password with RSA method,is there a source code to realize this function?Thanks!Best regards,Edward
[282 byte] By [EdwardKinga] at [2007-11-27 4:58:03]
# 1

Actually you don't want to do any of this. Storing encrypted passwords anywhere is a major security breach. What you should be doing is forming a MessageDigest (a one-way encryption) of the password and storing that. When someone logs in, you digest the password they entered and see if the digests match.

ejpa at 2007-7-12 10:13:49 > top of Java-index,Security,Cryptography...
# 2

In addition to what the previous poster said, RSA is a public key cipher which is more suited for things like digital signatures. If you are performing authentication services, you should follow the previous poster's advice.

However, if you are still want to use RSA, here is a link to give you a start.

http://www.aviransplace.com/index.php/archives/2004/10/12/using-rsa-encryption-with-java/

DarumAa at 2007-7-12 10:13:49 > top of Java-index,Security,Cryptography...