java.lang.Object
org.refcodes.security.alt.chaos.ChaosDecrypter
- All Implemented Interfaces:
org.refcodes.mixin.Disposable,org.refcodes.security.Decrypter<byte[],byte[], org.refcodes.security.DecryptionException>
public class ChaosDecrypter
extends Object
implements org.refcodes.security.Decrypter<byte[],byte[],org.refcodes.security.DecryptionException>
The
ChaosDecrypter will use byte arrays as input and output types.-
Constructor Summary
ConstructorsModifierConstructorDescriptionChaosDecrypter(ChaosKey aKey) Instantiates a newChaosDecrypterusing the givenChaosKeyfor decrypting.ChaosDecrypter(ChaosKey aKey, int aChildDepth) Instantiates a newChaosDecrypterusing the givenChaosKeyfor decrypting.protectedChaosDecrypter(ChaosKey aKey, int aChildDepth, ChaosDecrypter aChildDecrypter) Instantiates a newChaosDecrypterusing the givenChaosKeyfor encrypting and the givenChaosDecrypteras _child encrypter: TTheChaosKeymust therefore have no childChaosKeyas the childChaosDecrypterthen cannot unambiguously be determined! -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()byte[]toDecrypted(byte[] aEncrypted) inttoDecrypted(byte[] aBuffer, int aOffset, int aLength, byte[] aOutBuffer, int aOutOffset) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.security.Decrypter
decrypt, decrypt
-
Constructor Details
-
ChaosDecrypter
Instantiates a newChaosDecrypterusing the givenChaosKeyfor decrypting.- Parameters:
aKey- TheChaosKeyto use for decrypting.
-
ChaosDecrypter
Instantiates a newChaosDecrypterusing the givenChaosKeyfor decrypting.- Parameters:
aKey- TheChaosKeyto use for decrypting.aChildDepth- The number of children to consider when creating theChaosDecrypter.
-
ChaosDecrypter
Instantiates a newChaosDecrypterusing the givenChaosKeyfor encrypting and the givenChaosDecrypteras _child encrypter: TTheChaosKeymust therefore have no childChaosKeyas the childChaosDecrypterthen cannot unambiguously be determined! Attention: This constructor usually only is used by libraries which retrieve the various keys in different processing steps (seeChaosDecryptionInputStream).- Parameters:
aKey- TheChaosKeyto use for decrypting.aChildDepth- The number of children to consider when creating theChaosDecrypter.aChildDecrypter- The childChaosDecrypterto be used as child decrypter.- Throws:
IllegalArgumentException- thrown in case the chaos key has a child key and a child decrypter is provided as well (either the one or the other only is allowed).
-
-
Method Details
-
toDecrypted
public byte[] toDecrypted(byte[] aEncrypted) throws org.refcodes.security.DecryptionException - Specified by:
toDecryptedin interfaceorg.refcodes.security.Decrypter<byte[],byte[], org.refcodes.security.DecryptionException> - Throws:
org.refcodes.security.DecryptionException
-
toDecrypted
public int toDecrypted(byte[] aBuffer, int aOffset, int aLength, byte[] aOutBuffer, int aOutOffset) throws org.refcodes.security.DecryptionException - Specified by:
toDecryptedin interfaceorg.refcodes.security.Decrypter<byte[],byte[], org.refcodes.security.DecryptionException> - Throws:
org.refcodes.security.DecryptionException
-
dispose
public void dispose()- Specified by:
disposein interfaceorg.refcodes.mixin.Disposable
-
toString
-