/** This code snippet was taken from freecodesnippets.com*/
public class Main {
public static void main(String arg[]) throws Exception {
System.out.println(encrypt("String"));
}
public static byte[] encrypt(String x) throws Exception {
java.security.MessageDigest d = null;
d = java.security.MessageDigest.getInstance("SHA-1");
d.reset();
d.update(x.getBytes());
return d.digest();
}
}
No replies to this topic
#1
Posted 25 January 2010 - 07:46 PM
Java Encrypt a Password
|
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









