Here you can find the source of des3EncodeECB(byte[] key, byte[] data)
public static byte[] des3EncodeECB(byte[] key, byte[] data) throws Exception
//package com.java2s; //License from project: Apache License import javax.crypto.Cipher; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESedeKeySpec; import java.security.Key; public class Main { public static byte[] des3EncodeECB(byte[] key, byte[] data) throws Exception { Key deskey = null;//w w w .j av a 2 s . c o m DESedeKeySpec spec = new DESedeKeySpec(key); SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede"); deskey = keyfactory.generateSecret(spec); Cipher cipher = Cipher.getInstance("desede" + "/ECB/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, deskey); byte[] bOut = cipher.doFinal(data); return bOut; } }