Java tutorial
//package com.java2s; //License from project: Open Source License import android.util.Log; import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { static final String TAG = "jamorham cip"; static final byte[] errorbyte = {}; private static byte[] getKeyBytes(String mykey) { try { MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); digest.update(mykey.getBytes(Charset.forName("UTF-8"))); return digest.digest(); } catch (NoSuchAlgorithmException e) { Log.e(TAG, "Password creation exception: " + e.toString()); return errorbyte; } } }