Package com.openstego.desktop
Class OpenStegoCrypto
- java.lang.Object
-
- com.openstego.desktop.OpenStegoCrypto
-
public class OpenStegoCrypto extends java.lang.Object
This is the class for providing cryptography support to OpenStego.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALGO_AES128
Constant for algorithm - AES128static java.lang.String
ALGO_AES256
Constant for algorithm - AES256static java.lang.String
ALGO_DES
Constant for algorithm - DES
-
Constructor Summary
Constructors Constructor Description OpenStegoCrypto(java.lang.String password, java.lang.String algorithm)
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decrypt(byte[] input)
Method to decrypt the databyte[]
encrypt(byte[] input)
Method to encrypt the data
-
-
-
Field Detail
-
ALGO_DES
public static final java.lang.String ALGO_DES
Constant for algorithm - DES- See Also:
- Constant Field Values
-
ALGO_AES128
public static final java.lang.String ALGO_AES128
Constant for algorithm - AES128- See Also:
- Constant Field Values
-
ALGO_AES256
public static final java.lang.String ALGO_AES256
Constant for algorithm - AES256- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OpenStegoCrypto
public OpenStegoCrypto(java.lang.String password, java.lang.String algorithm) throws OpenStegoException
Default constructor- Parameters:
password
- Password to use for encryptionalgorithm
- Cryptography algorithm to use. If null or blank value is provided, then it defaults to AES128- Throws:
OpenStegoException
-
-
Method Detail
-
encrypt
public byte[] encrypt(byte[] input) throws OpenStegoException
Method to encrypt the data- Parameters:
input
- Data to be encrypted- Returns:
- Encrypted data
- Throws:
OpenStegoException
-
decrypt
public byte[] decrypt(byte[] input) throws OpenStegoException
Method to decrypt the data- Parameters:
input
- Data to be decrypted- Returns:
- Decrypted data (returns
null
if password is invalid) - Throws:
OpenStegoException
-
-