Security.addProvider(new com.sun.crypto.provider.SunJCE());
Key key = new SecretKeySpec(secretKey.getBytes(), "DES");
encryptCipher = Cipher.getInstance("DES");
encryptCipher.init(Cipher.ENCRYPT_MODE, key);
Key key = new SecretKeySpec(secretKey.getBytes(), "DES");
encryptCipher = Cipher.getInstance("DES");
encryptCipher.init(Cipher.ENCRYPT_MODE, key);
8個密鑰字符串,
3des是最少是16個密鑰字符串。這個是關鍵。
基本思路:簽約號取后10位+yyMMdd 16位作為des密鑰,生成密鑰的話就是8個密鑰串。