Here you can find the source of encrypt(String property)
static String encrypt(String property)
//package com.java2s; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; import android.util.Base64; public class Main { private static final char[] PASSWORD = "enfldsgbnlsngdlksdsgm" .toCharArray();/*from w w w. ja v a 2 s . c om*/ private static final byte[] SALT = { (byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12, (byte) 0xde, (byte) 0x33, (byte) 0x10, (byte) 0x12, }; static String encrypt(String property) { try { SecretKeyFactory keyFactory = SecretKeyFactory .getInstance("PBEWithMD5AndDES"); SecretKey key = keyFactory.generateSecret(new PBEKeySpec( PASSWORD)); Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec( SALT, 20)); return base64Encode(pbeCipher.doFinal(property .getBytes("UTF-8"))); } catch (Exception e) { e.printStackTrace(); return ""; } } private static String base64Encode(byte[] bytes) { // NB: This class is internal, and you probably should use another impl return Base64.encodeToString(bytes, Base64.DEFAULT); } }