初始化

This commit is contained in:
2022-08-24 09:32:54 +08:00
parent 0d349c559c
commit 8e4d517c40
800 changed files with 74927 additions and 20 deletions
@@ -0,0 +1,40 @@
package com.arpa.hndahesudintocctmsdriver.util.log;
import android.util.Log;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
/**
* @author hlh
* @version 1.0.0
* @date 2022/1/10 16:55
* @description:日志工具类
*/
public class LogUtil{
public static void show(String title,String value){
Log.e(title,value);
Log.d(title,value);
}
public static byte[] desDecrypt(byte[] encryptText, String desKeyParameter) throws Exception {
SecureRandom sr = new SecureRandom();
byte rawKeyData[] = desKeyParameter.getBytes();
DESKeySpec dks = new DESKeySpec(rawKeyData);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey key = keyFactory.generateSecret(dks);
Cipher cipher = Cipher.getInstance("DES");
cipher.init(Cipher.DECRYPT_MODE, key, sr);
byte encryptedData[] = encryptText;
byte decryptedData[] = cipher.doFinal(encryptedData);
return decryptedData;
}
}