Here you can find the source of decode(String key, byte[] data)
public static byte[] decode(String key, byte[] data) throws Exception
//package com.java2s; import javax.crypto.Cipher; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; import javax.crypto.spec.IvParameterSpec; import java.security.Key; import java.security.spec.AlgorithmParameterSpec; public class Main { public static final String ALGORITHM_DES = "DES/CBC/PKCS5Padding"; public static byte[] decode(String key, byte[] data) throws Exception { try {/*w w w . j av a 2 s .com*/ DESKeySpec dks = new DESKeySpec(key.getBytes()); SecretKeyFactory keyFactory = SecretKeyFactory .getInstance("DES"); Key secretKey = keyFactory.generateSecret(dks); Cipher cipher = Cipher.getInstance(ALGORITHM_DES); IvParameterSpec iv = new IvParameterSpec(key.getBytes()); AlgorithmParameterSpec paramSpec = iv; cipher.init(Cipher.DECRYPT_MODE, secretKey, paramSpec); return cipher.doFinal(data); } catch (Exception e) { throw new Exception(e); } } }