Java examples for Security:MD5
Encode using apache codec Base64
import org.apache.commons.codec.binary.Base64; public class encode{ public static void main(String args[]) throws IOException { String orig = "core"; byte[] encoded = Base64.encodeBase64(orig.getBytes()); System.out.println("Original String: " + orig ); System.out.println("Base64 Encoded String : " + new String(encoded)); }/*w w w. j a v a 2 s . c o m*/ }