Package rs.baselib.crypto
Class DefaultCryptingDelegate
java.lang.Object
rs.baselib.crypto.DefaultCryptingDelegate
- All Implemented Interfaces:
ICryptingDelegate
Implements basic crypting decrypting.
- Author:
- ralph
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] bytes) Decrypts the given bytes.byte[]
encrypt
(byte[] bytes) Encrypts the given bytes.void
init
(ICryptingDelegateFactory factory) Initializes this instance.boolean
Returns true when the crypting algorithm is block based.
-
Constructor Details
-
DefaultCryptingDelegate
public DefaultCryptingDelegate()Constructor.
-
-
Method Details
-
init
Initializes this instance.- Specified by:
init
in interfaceICryptingDelegate
- Parameters:
factory
- the factory providing initialization parameters
-
encrypt
Encrypts the given bytes.- Specified by:
encrypt
in interfaceICryptingDelegate
- Parameters:
bytes
- bytes to be encrypted- Returns:
- encrypted bytes
- Throws:
Exception
- when an error occurs
-
decrypt
Decrypts the given bytes.- Specified by:
decrypt
in interfaceICryptingDelegate
- Parameters:
bytes
- bytes to be decrypted- Returns:
- decrypted bytes
- Throws:
Exception
- when an error occurs
-
isBlockBased
public boolean isBlockBased()Returns true when the crypting algorithm is block based.- Returns:
- true or false
-