|
@@ -76,16 +76,16 @@ public class DesUtil {
|
|
|
* 指定的密钥
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public DesUtil(String strKey) throws Exception {
|
|
|
- Security.addProvider(new com.sun.crypto.provider.SunJCE());
|
|
|
- Key key = getKey(strKey.getBytes());
|
|
|
-
|
|
|
- encryptCipher = Cipher.getInstance("DES");
|
|
|
- encryptCipher.init(Cipher.ENCRYPT_MODE, key);
|
|
|
-
|
|
|
- decryptCipher = Cipher.getInstance("DES");
|
|
|
- decryptCipher.init(Cipher.DECRYPT_MODE, key);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
* 加密字节数组
|