public class SecurityUtils extends Object
https://docs.oracle.com/en/java/javase/17/security/
| 构造器和说明 |
|---|
SecurityUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
desCbc(@NonNull byte[] key,
@NonNull byte[] icv,
@NonNull byte[] in,
boolean encrypting,
org.bouncycastle.crypto.paddings.BlockCipherPadding padding)
DES 算法 CBC 模式加解密
|
static String |
desCbc(@NonNull String key,
@NonNull String icv,
@NonNull String in,
boolean encrypting,
org.bouncycastle.crypto.paddings.BlockCipherPadding padding)
DES 算法 CBC 模式加解密
|
static byte[] |
desEcb(@NonNull byte[] key,
@NonNull byte[] in,
boolean encrypting,
org.bouncycastle.crypto.paddings.BlockCipherPadding padding)
DES 算法 ECB 模式加解密
|
static String |
desEcb(@NonNull String key,
@NonNull String in,
boolean encrypting,
org.bouncycastle.crypto.paddings.BlockCipherPadding padding)
DES 算法 ECB 模式加解密
|
public static byte[] desEcb(@NonNull
@NonNull byte[] key,
@NonNull
@NonNull byte[] in,
boolean encrypting,
org.bouncycastle.crypto.paddings.BlockCipherPadding padding)
throws org.bouncycastle.crypto.InvalidCipherTextException
key - 8 字节密钥in - 数据encrypting - 是否为加密padding - 填充类型org.bouncycastle.crypto.InvalidCipherTextException - 意想不到的异常public static String desEcb(@NonNull @NonNull String key, @NonNull @NonNull String in, boolean encrypting, org.bouncycastle.crypto.paddings.BlockCipherPadding padding) throws org.bouncycastle.crypto.InvalidCipherTextException, InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException
key - 密钥in - 数据encrypting - 是否为加密padding - 填充类型org.bouncycastle.crypto.InvalidCipherTextException - 意想不到的异常InvalidKeyException - invalid Keys (invalid encoding, wrong length, uninitialized, etc)NoSuchAlgorithmException - a particular cryptographic algorithm is requested but is not available in the environmentInvalidKeySpecException - invalid key specificationspublic static byte[] desCbc(@NonNull
@NonNull byte[] key,
@NonNull
@NonNull byte[] icv,
@NonNull
@NonNull byte[] in,
boolean encrypting,
org.bouncycastle.crypto.paddings.BlockCipherPadding padding)
throws org.bouncycastle.crypto.InvalidCipherTextException
key - 8 字节密钥icv - 8 字节向量in - 数据encrypting - 是否为加密padding - 填充类型org.bouncycastle.crypto.InvalidCipherTextException - 意想不到的异常public static String desCbc(@NonNull @NonNull String key, @NonNull @NonNull String icv, @NonNull @NonNull String in, boolean encrypting, org.bouncycastle.crypto.paddings.BlockCipherPadding padding) throws org.bouncycastle.crypto.InvalidCipherTextException, InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException
key - 密钥in - 数据encrypting - 是否为加密padding - 填充类型org.bouncycastle.crypto.InvalidCipherTextException - 意想不到的异常InvalidKeyException - invalid Keys (invalid encoding, wrong length, uninitialized, etc)NoSuchAlgorithmException - a particular cryptographic algorithm is requested but is not available in the environmentInvalidKeySpecException - invalid key specificationsCopyright © 2022. All rights reserved.