Package org.refcodes.security.alt.chaos
Class ChaosTextEncrypter
- java.lang.Object
-
- org.refcodes.security.alt.chaos.ChaosTextEncrypter
-
- All Implemented Interfaces:
org.refcodes.mixin.Disposable
,org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
public class ChaosTextEncrypter extends Object implements org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
TheChaosTextEncrypter
will useString
as input and output type.
-
-
Constructor Summary
Constructors Constructor Description ChaosTextEncrypter(ChaosKey aKey)
Instantiates a newChaosTextEncrypter
using the givenChaosKey
for encrypting.ChaosTextEncrypter(ChaosKey aKey, boolean isVerify)
Instantiates a newChaosTextEncrypter
using the givenChaosKey
for encrypting.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
int
toEncrypted(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset)
String
toEncrypted(String aDecrypted)
-
-
-
Constructor Detail
-
ChaosTextEncrypter
public ChaosTextEncrypter(ChaosKey aKey)
Instantiates a newChaosTextEncrypter
using the givenChaosKey
for encrypting.- Parameters:
aKey
- TheChaosKey
to use for encrypting.
-
ChaosTextEncrypter
public ChaosTextEncrypter(ChaosKey aKey, boolean isVerify)
Instantiates a newChaosTextEncrypter
using the givenChaosKey
for encrypting.- Parameters:
aKey
- TheChaosKey
to use for encrypting.isVerify
- When true then the encryption is verified against an according live decryption to throw anIllegalStateException
in case encryption and decryption differ.
-
-
Method Detail
-
toEncrypted
public String toEncrypted(String aDecrypted) throws org.refcodes.security.EncryptionException
-
toEncrypted
public int toEncrypted(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset) throws org.refcodes.security.EncryptionException
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.refcodes.mixin.Disposable
-
-