· 9 years ago · Dec 21, 2016, 06:04 PM
1byte[] key24 = [-17, 55, 99, -54, -20, -99, -79, -34, -123, -100, -118, -42, -111, -108, -62, 123, -17, 55, 99, -54, -20, -99, -79, -34];
2
3byte[] data = [-1, -1, -1, 0, 6, 0, 34, 96];
4String algorithm = "DESede";
5String mode = "DESede/ECB/NoPadding";
6
7
8KeySpec confKey = new DESedeKeySpec(key24);
9SecretKeyFactory spcKey = SecretKeyFactory.getInstance(algorithm);
10Cipher cifermode = Cipher.getInstance(mode);
11SecretKey secretKey = spcKey.generateSecret(confKey);
12output = cifermode.doFinal(data);
13System.err.println("cifrado: "+output);
14
15resultado: [-101, 23, 28, -119, -62, -119, -18, 57]