Interface CryptInterface

All Superinterfaces:
ModInterface
All Known Implementing Classes:
BFishMod

public interface CryptInterface
extends ModInterface

All modules must implement the methods defined by this class to work properly with the Class Encrypt Encryption Program.


Method Summary
 byte[] decrypt(java.io.File file)
          This method is used for decrypting files that were encrypted by the specific algorithm.
 java.io.File encrypt(java.io.File file)
          This method is for encrypting a single file.
 void setKey(byte[] key)
          This method is used to set the key for the encryption algorithm module.
 
Methods inherited from interface ModInterface
handles
 

Method Detail

encrypt

public java.io.File encrypt(java.io.File file)
                     throws java.lang.Exception
This method is for encrypting a single file. It should return the encrypted version of the file so that the application can write the file to the proper location.

Returns:
File the file after it has been encrypted.
Throws:
java.lang.Exception - This is just in case your implementation throws junk

decrypt

public byte[] decrypt(java.io.File file)
               throws java.lang.Exception
This method is used for decrypting files that were encrypted by the specific algorithm. It returns a byte array in order to prevent the decrypted class file from being written to disk. Be sure that your implementation retains this otherwise it will potentially be unsafe since the dynamic class loader will be using this implementation to decrypt the class files before loading them into memory.

Returns:
byte[] the file after it has been decrypted (in array form instead of a File)
Throws:
java.lang.Exception - This is just in case your implementation throws junk

setKey

public void setKey(byte[] key)
            throws java.lang.Exception
This method is used to set the key for the encryption algorithm module. If your module does not use a key, or if it is constant, simply leave the method body empty.

Throws:
java.lang.Exception - This is just in case your implementation throws junk