|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dmonix.cipher.DataCipherer
Utility class for encoding/decoding small amounts of data using ciphers.
The class is designed to encode/decode smaller amounts of data, e.g.
strings that are to be stored on file or in a database.
The class can also encode/decode files.
If larger amounts of streamed data is to be encoded/decoded it is advised to use
any of the sub classes to DMCipherInputStream and
DMCipherOutputStream.
Copyright: Copyright (c) 2004
Company: dmonix.org
| Constructor Summary | |
DataCipherer()
|
|
| Method Summary | |
java.lang.Object |
clone()
THIS METHOD IS NOT SUPPORTED! |
static byte[] |
decodeDataDES(byte[] b,
byte[] key)
Decodes the data using the DES algorithm. |
static byte[] |
decodeDataPBE(byte[] b,
char[] key)
Decodes the data using the PBEWithMD5AndDES algorithm. |
static void |
decodeFileDES(java.io.File input,
java.io.File output,
byte[] key)
Decodes a single file using the DES algorithm. |
static void |
decodeFilePBE(java.io.File input,
java.io.File output,
char[] key)
Decodes a single file using the PBE algorithm. |
static byte[] |
encodeDataDES(byte[] b,
byte[] key)
Encodes the data using the DES algorithm. |
static byte[] |
encodeDataPBE(byte[] b,
char[] key)
Encodes the data using the PBEWithMD5AndDES algorithm. |
static void |
encodeFileDES(java.io.File input,
java.io.File output,
byte[] key)
Encodes a file using the DES algorithm |
static void |
encodeFilePBE(java.io.File input,
java.io.File output,
char[] key)
Encodes a single file using the PBE algorithm. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DataCipherer()
| Method Detail |
public static byte[] encodeDataDES(byte[] b,
byte[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
b - The data to encodekey - The key for the cipher algoritm, must be exactly 8 bytes long (required by the algorithm)
java.io.IOException
java.security.GeneralSecurityException
public static byte[] encodeDataPBE(byte[] b,
char[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
b - The data to encodekey - The key for the cipher algoritm
java.io.IOException
java.security.GeneralSecurityException
public static byte[] decodeDataDES(byte[] b,
byte[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
b - The data to decodekey - The key for the cipher algoritm, must be exactly 8 bytes long (required by the algorithm)
java.io.IOException
java.security.GeneralSecurityException
public static byte[] decodeDataPBE(byte[] b,
char[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
b - The data to decodekey - The key for the cipher algoritm
java.io.IOException
java.security.GeneralSecurityException
public static void encodeFileDES(java.io.File input,
java.io.File output,
byte[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
input - The input fileoutput - The output filekey - The key, must be exactly 8 bytes long (required by the algorithm)
java.io.IOException
java.security.GeneralSecurityException
public static void encodeFilePBE(java.io.File input,
java.io.File output,
char[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
input - The input (original) fileoutput - The output (coded) filekey - The key to use for the encoding
java.io.IOException
java.security.GeneralSecurityExceptionDMCipherOutputStreamPBE
public static void decodeFileDES(java.io.File input,
java.io.File output,
byte[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
input - The input (coded) fileoutput - The output (decoded) filekey - The key to use for the encoding, must be exactly 8 bytes long (required by the algorithm)
java.io.IOException
java.security.GeneralSecurityExceptionDMCipherInputStreamDES
public static void decodeFilePBE(java.io.File input,
java.io.File output,
char[] key)
throws java.io.IOException,
java.security.GeneralSecurityException
input - The input (coded) fileoutput - The output (decoded) filekey - The key to use for the encoding
java.io.IOException
java.security.GeneralSecurityExceptionDMCipherInputStreamPBE
public final java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException - The exception is always thrown
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||