Here you can find the source of encryptStrBuff(byte[] resultBytes)
public static String encryptStrBuff(byte[] resultBytes)
//package com.java2s; //License from project: Open Source License public class Main { public static String encryptStrBuff(byte[] resultBytes) { StringBuffer strBuff = new StringBuffer(); for (int i = 0; i < resultBytes.length; i++) { if (Integer.toHexString(0xFF & resultBytes[i]).length() == 1) { strBuff.append("0").append(Integer.toHexString(0xFF & resultBytes[i])); } else { strBuff.append(Integer.toHexString(0xFF & resultBytes[i])); }//w w w .j a v a 2 s. c om } return strBuff.toString(); } }