@Test void ecbDecrypt() throws DecoderException, UnsupportedEncodingException { String source = "1d6ca0a793eba254b4950253b11b7897860c497ee6cae7f3b2d8035beccb5ab41411467a32786a72a7b2809952fa5a804a37a4028f72b48cd7e22bc3d400b43358f40c327900dff1dc14c322506b4aba87375aa7e0d3b6689eb52fd06ba30ae3"; String key = "q9YCl%!3*m#d&3Ke"; System.out.println(Base64.encodeToString(Hex.decodeHex(source.toCharArray()))); byte[] reponse = {120,-100,-85,86,74,45,42,-54,47,114,-50,79,73,85,-78,82,-78,4,2,37,29,-91,-36,-44,-30,-30,-60,116,-112,-64,-117,-11,75,95,108,89,-10,-76,127,-5,-45,13,-77,-98,-51,89,-11,108,-13,-118,-89,109,61,74,-75,0,69,58,25,83}; System.out.println(new String(reponse,"utf-8")); byte[] result = AESEncryptionUtil.getInstance().ecbDecrypt(reponse,key.getBytes()); System.out.println("source : "+ new String(AESEncryptionUtil.getInstance().ecbDecrypt(Base64.decode(result),key.getBytes()))); }
public byte[] ecbDecrypt(byte[] data, byte[] key){ return BasicEncryptionUtil.getInstance().decrypt(HelperHolder.ALGORITHM, HelperHolder.ALGORITHM_ECB_KEY, key, null, data); }
AESEncryptionUtil { public byte[] ecbDecrypt(byte[] data, byte[] key){ return BasicEncryptionUtil.getInstance().decrypt(HelperHolder.ALGORITHM, HelperHolder.ALGORITHM_ECB_KEY, key, null, data); } }
AESEncryptionUtil { public byte[] ecbDecrypt(byte[] data, byte[] key){ return BasicEncryptionUtil.getInstance().decrypt(HelperHolder.ALGORITHM, HelperHolder.ALGORITHM_ECB_KEY, key, null, data); } private  AESEncryptionUtil(); }
AESEncryptionUtil { public byte[] ecbDecrypt(byte[] data, byte[] key){ return BasicEncryptionUtil.getInstance().decrypt(HelperHolder.ALGORITHM, HelperHolder.ALGORITHM_ECB_KEY, key, null, data); } private  AESEncryptionUtil(); static AESEncryptionUtil getInstance(); byte[] cbcEncrypt(byte[] data, byte[] key, byte[] ivp); byte[] cbcDecrypt(byte[] data, byte[] key, byte[] ivp); byte[] ecbEncrypt(byte[] data, byte[] key); byte[] ecbDecrypt(byte[] data, byte[] key); }
AESEncryptionUtil { public byte[] ecbDecrypt(byte[] data, byte[] key){ return BasicEncryptionUtil.getInstance().decrypt(HelperHolder.ALGORITHM, HelperHolder.ALGORITHM_ECB_KEY, key, null, data); } private  AESEncryptionUtil(); static AESEncryptionUtil getInstance(); byte[] cbcEncrypt(byte[] data, byte[] key, byte[] ivp); byte[] cbcDecrypt(byte[] data, byte[] key, byte[] ivp); byte[] ecbEncrypt(byte[] data, byte[] key); byte[] ecbDecrypt(byte[] data, byte[] key);  }