本文主要是介绍DES 加密 DES/ECB/PKCS7Padding,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
依赖
<dependency><groupId>org.bouncycastle</groupId><artifactId>bcprov-jdk15on</artifactId><version>1.60</version></dependency>
package com.sentemail.DES;import java.security.SecureRandom;
import java.security.Security;
/*扩展类*/
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;import org.bouncycastle.jce.provider.BouncyCastleProvider;public class EncryptUtil {static { // 适配PKCS7Padding填充Security.addProvider(new BouncyCastleProvider());}/** 加密、解密key. */private static final String PASSWORD_CRYPT_KEY = "EPICC_DESKEY_QYWX";
这篇关于DES 加密 DES/ECB/PKCS7Padding的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!