public class DESedeEncryption
extends java.lang.Object
| Constructor and Description |
|---|
DESedeEncryption() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decrypt(java.lang.String encryptString,
java.lang.String strKeySpec)
解密
|
static java.lang.String |
decrypt(java.lang.String encryptString,
java.lang.String chartCode,
java.lang.String strKeySpec)
此method之功能解密
|
static java.lang.String |
encrypt(java.lang.String input,
java.lang.String strKeySpec)
加密
|
static java.lang.String |
encrypt(java.lang.String input,
java.lang.String chartCode,
java.lang.String strKeySpec)
此method之功能為加密
|
public static java.lang.String encrypt(java.lang.String input,
java.lang.String strKeySpec)
throws java.lang.Exception
input - 欲加密文字strKeySpec - 加解密值keyjava.lang.Exceptionpublic static java.lang.String decrypt(java.lang.String encryptString,
java.lang.String strKeySpec)
throws java.lang.Exception
encryptString - 欲解密文字strKeySpec - 加解密值keyjava.lang.Exceptionpublic static java.lang.String encrypt(java.lang.String input,
java.lang.String chartCode,
java.lang.String strKeySpec)
throws java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
java.io.UnsupportedEncodingException,
javax.crypto.NoSuchPaddingException,
java.security.spec.InvalidKeySpecException,
java.security.NoSuchAlgorithmException
input - 欲加密之文字chartCode - 文字編碼:UTF-8,UTF-16strKeySpec - 欲產生共用鑰匙之規範,其長度需大約24。java.security.InvalidKeyExceptionjavax.crypto.BadPaddingExceptionjavax.crypto.IllegalBlockSizeExceptionjava.io.UnsupportedEncodingExceptionjavax.crypto.NoSuchPaddingExceptionjava.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmExceptionpublic static java.lang.String decrypt(java.lang.String encryptString,
java.lang.String chartCode,
java.lang.String strKeySpec)
throws java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
java.io.UnsupportedEncodingException,
java.io.IOException,
javax.crypto.NoSuchPaddingException,
java.security.spec.InvalidKeySpecException,
java.security.NoSuchAlgorithmException
encryptString - 加密後之文字chartCode - 文字編碼:UTF-8,UTF-16strKeySpec - 欲產生共用鑰匙之規範,其長度需大約24。java.security.InvalidKeyExceptionjavax.crypto.BadPaddingExceptionjavax.crypto.IllegalBlockSizeExceptionjava.io.UnsupportedEncodingExceptionjava.io.IOExceptionjavax.crypto.NoSuchPaddingExceptionjava.security.spec.InvalidKeySpecExceptionjava.security.NoSuchAlgorithmException