Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encryption... urgent

Status
Not open for further replies.

elibb

Programmer
Oct 22, 2001
335
MX
hi.. how can i encrypt in java using MD5???

ive tried this:

public static void main(String []args)
{
try{
String tmp = new String("hello");
byte b2[]=tmp.getBytes();

MessageDigest tmp1 = MessageDigest.getInstance("MD5");

System.out.println("hash: " + hash1.asHex());
byte b1[]=tmp1.digest(b2)

}

catch(Exception e)
{
System.out.println(e.toString());

}

}
but no matter the word i want to encrypt i get the same result.
im trying to set up a radius server and thats why i need it.. any ideas???

thank you very much

Eli
 
I'm not quite sure what you want, what kind of encryption
are you looking for? 1-way or 2-way encryption?

If you search on about java encryption, you'll get some results on some class libraries you can use to encrypt data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top