junkutil.crypt
クラス DES

java.lang.Object
  上位を拡張 junkutil.crypt.DES

public class DES
extends java.lang.Object

共通鍵暗号/復号アルゴリズム。 DES,トリプルDES,AES,RC2,RC4等に対応

作成者:
Hiroyuki Shiota

フィールドの概要
static java.lang.String AES_ALGORITHM
           
static java.lang.String BLOWFISH_ALGORITHM
           
static java.lang.String DES_ALGORITHM
           
static java.lang.String DESEDE_ALGORITHM
           
static java.lang.String RC2_ALGORITHM
           
static java.lang.String RC4_ALGORITHM
           
 
コンストラクタの概要
DES()
          デフォルトのアルゴリズム
DES(java.lang.String algorithm)
          アルゴリズムを指定するコンストラクタ
 
メソッドの概要
 java.lang.String createKey()
          キー生成(ランダム)
 java.lang.String createKey(java.lang.String seed)
          キー生成(指定)
static byte[] decodeBASE64(java.lang.String value)
          BASE64でデコード
 byte[] decrypt(byte[] data, java.lang.String key)
          復号化する。
static java.lang.String encodeBASE64(byte[] bytes)
          BASE64でエンコード
 byte[] encrypt(byte[] data, java.lang.String key)
          暗号化する。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

DES_ALGORITHM

public static final java.lang.String DES_ALGORITHM
関連項目:
定数フィールド値

DESEDE_ALGORITHM

public static final java.lang.String DESEDE_ALGORITHM
関連項目:
定数フィールド値

AES_ALGORITHM

public static final java.lang.String AES_ALGORITHM
関連項目:
定数フィールド値

BLOWFISH_ALGORITHM

public static final java.lang.String BLOWFISH_ALGORITHM
関連項目:
定数フィールド値

RC2_ALGORITHM

public static final java.lang.String RC2_ALGORITHM
関連項目:
定数フィールド値

RC4_ALGORITHM

public static final java.lang.String RC4_ALGORITHM
関連項目:
定数フィールド値
コンストラクタの詳細

DES

public DES()
デフォルトのアルゴリズム


DES

public DES(java.lang.String algorithm)
アルゴリズムを指定するコンストラクタ

パラメータ:
algorithm -
メソッドの詳細

encodeBASE64

public static java.lang.String encodeBASE64(byte[] bytes)
BASE64でエンコード

パラメータ:
bytes -
戻り値:

decodeBASE64

public static byte[] decodeBASE64(java.lang.String value)
                           throws java.io.IOException
BASE64でデコード

パラメータ:
value -
戻り値:
例外:
java.io.IOException

createKey

public java.lang.String createKey()
                           throws java.security.NoSuchAlgorithmException,
                                  java.io.IOException
キー生成(ランダム)

戻り値:
例外:
java.security.NoSuchAlgorithmException
java.io.IOException

createKey

public java.lang.String createKey(java.lang.String seed)
                           throws java.security.NoSuchAlgorithmException,
                                  java.io.IOException
キー生成(指定)

パラメータ:
seed -
戻り値:
例外:
java.security.NoSuchAlgorithmException
java.io.IOException

encrypt

public byte[] encrypt(byte[] data,
                      java.lang.String key)
               throws java.io.IOException,
                      java.security.NoSuchAlgorithmException,
                      javax.crypto.NoSuchPaddingException,
                      java.security.InvalidKeyException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.BadPaddingException
暗号化する。

パラメータ:
data -
key -
戻り値:
例外:
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

decrypt

public byte[] decrypt(byte[] data,
                      java.lang.String key)
               throws java.io.IOException,
                      java.security.NoSuchAlgorithmException,
                      javax.crypto.NoSuchPaddingException,
                      java.security.InvalidKeyException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.BadPaddingException
復号化する。

パラメータ:
data -
key -
戻り値:
例外:
java.io.IOException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException