To vinayasimha:
Type "java encrypt" into Google. The first link I got is already promising:
http://www.databasejournal.com/features/mssql/article.php/1474581
"Using Java... Uses the powerful java Cryptography API..."
Try using google first. You will often get a lot more help, and a lot faster.