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>
The ChaosTextEncrypter will use String as input and output type.
  • Constructor Details

    • ChaosTextEncrypter

      public ChaosTextEncrypter(ChaosKey aKey)
      Instantiates a new ChaosTextEncrypter using the given ChaosKey for encrypting.
      Parameters:
      aKey - The ChaosKey to use for encrypting.
    • ChaosTextEncrypter

      public ChaosTextEncrypter(ChaosKey aKey, boolean isVerify)
      Instantiates a new ChaosTextEncrypter using the given ChaosKey for encrypting.
      Parameters:
      aKey - The ChaosKey to use for encrypting.
      isVerify - When true then the encryption is verified against an according live decryption to throw an IllegalStateException in case encryption and decryption differ.
  • Method Details

    • toEncrypted

      public String toEncrypted(String aDecrypted) throws org.refcodes.security.EncryptionException
      Specified by:
      toEncrypted in interface org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
      Throws:
      org.refcodes.security.EncryptionException
    • toEncrypted

      public int toEncrypted(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset) throws org.refcodes.security.EncryptionException
      Specified by:
      toEncrypted in interface org.refcodes.security.Encrypter<String,String,org.refcodes.security.EncryptionException>
      Throws:
      org.refcodes.security.EncryptionException
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.refcodes.mixin.Disposable