Here you can find the source of encryptBase64(byte[] source)
public static String encryptBase64(byte[] source) throws Throwable
//package com.java2s; import javax.crypto.Cipher; import android.util.Base64; public class Main { private static Cipher encryptCipher; public static String encryptBase64(byte[] source) throws Throwable { if (source == null || source.length < 1) { return null; }// w w w .ja va2 s . c om byte[] encrypted = encryptCipher.doFinal(source); return Base64.encodeToString(encrypted, Base64.NO_WRAP); } }