// Path: encoder/src/main/java/ru/bullyboo/encoder/constants/Constants.java
// public class Constants {
// 
//     /**
//      * Exceptions messages
//      */
//     public static final String MESSAGE_EXCEPTION = "Message was not set";
//     public static final String METHOD_EXCEPTION = "Method was not set";
//     public static final String METHOD_CFB_OFB_EXCEPTION = "Wrong method number. Set the method number between 8 and 128";
//     public static final String KEY_SIZE_EXCEPTION = "Key size can`t be equal to 0";
//     public static final String LESS_ZERO_KEY_SIZE_EXCEPTION = "Key size can`t be less than 0";
// 
//     public static final String RSA_KEY_EXCEPTION = "Wrong key size value. Set the key size between 512 and 65536";
//     public static final String RSA_KEY_MULTIPLY_EXCEPTION = "Wrong key size value. Key must be a multiple of 64";
//     public static final String RSA_KEY_CALLBACK_EXCEPTION = "Key Callback was not set";
//     public static final String RSA_HAS_NOT_KEY_EXCEPTION = "Private key was not set. Try to use privateKey() or key() methods";
//     public static final String RSA_KEY_SIZE_EXCEPTION = "Key size was not set";
// 
//     public static final String PBE_KEY_SIZE_EXCEPTION = "Key size is not valid. Key size must be: ";
// 
// }
// 
// Path: encoder/src/main/java/ru/bullyboo/encoder/methods/ARCFOUR.java
// public class ARCFOUR extends BaseMethod{
// 
//     /**
//      * ARCFOUR method
//      */
//     private static final String ARCFOUR = "ARCFOUR";
// 
//     /**
//      * Implementation of ARCFOUR encryption
//      */
//     public static String encrypt(byte[] key, int keySize, byte[] message) throws Exception {
// 
// //        generate Key
//         byte[] keyBytes = generateKey(key, keySize);
//         SecretKeySpec keySpec = new SecretKeySpec(keyBytes, ARCFOUR);
// 
//         Cipher cipher = Cipher.getInstance(ARCFOUR);
//         cipher.init(Cipher.ENCRYPT_MODE, keySpec);
//         byte[] cipherText = cipher.doFinal(message);
// 
//         return Base64.encodeToString(cipherText, Base64.DEFAULT);
//     }
// 
//     /**
//      * Implementation of ARCFOUR decryption
//      */
//     public static String decrypt(byte[] key, int keySize, byte[] message) throws Exception {
// 
// //        generate Key
//         byte[] keyBytes = generateKey(key, keySize);
//         SecretKeySpec keySpec = new SecretKeySpec(keyBytes, ARCFOUR);
// 
//         Cipher cipher = Cipher.getInstance(ARCFOUR);
//         cipher.init(Cipher.ENCRYPT_MODE, keySpec);
//         byte[] cipherText = cipher.doFinal(Base64.decode(message, Base64.DEFAULT));
// 
//         return new String(cipherText);
//     }
// }


import ru.bullyboo.encoder.constants.Constants;
import ru.bullyboo.encoder.methods.ARCFOUR;
    public BuilderARCFOUR key(String key, int keySize) {
        this.key = key.getBytes();
        this.keySize = keySize;
        return this;
    }

    public BuilderARCFOUR key(byte[] key, int keySize) {
        this.key = key;
        this.keySize = keySize;
        return this;
    }

    public BuilderARCFOUR keySize(int keySize) {
        this.keySize = keySize;
        return this;
    }

    @Override
    String encryption() throws Exception {
        return ARCFOUR.encrypt(key, keySize, message);
    }

    @Override
    String decryption() throws Exception {
        return ARCFOUR.decrypt(key, keySize, message);
    }

    @Override
    boolean hasEnoughData() {
        if(message == null){
// Path: encoder/src/main/java/ru/bullyboo/encoder/constants/Constants.java
// public class Constants {
// 
//     /**
//      * Exceptions messages
//      */
//     public static final String MESSAGE_EXCEPTION = "Message was not set";
//     public static final String METHOD_EXCEPTION = "Method was not set";
//     public static final String METHOD_CFB_OFB_EXCEPTION = "Wrong method number. Set the method number between 8 and 128";
//     public static final String KEY_SIZE_EXCEPTION = "Key size can`t be equal to 0";
//     public static final String LESS_ZERO_KEY_SIZE_EXCEPTION = "Key size can`t be less than 0";
// 
//     public static final String RSA_KEY_EXCEPTION = "Wrong key size value. Set the key size between 512 and 65536";
//     public static final String RSA_KEY_MULTIPLY_EXCEPTION = "Wrong key size value. Key must be a multiple of 64";
//     public static final String RSA_KEY_CALLBACK_EXCEPTION = "Key Callback was not set";
//     public static final String RSA_HAS_NOT_KEY_EXCEPTION = "Private key was not set. Try to use privateKey() or key() methods";
//     public static final String RSA_KEY_SIZE_EXCEPTION = "Key size was not set";
// 
//     public static final String PBE_KEY_SIZE_EXCEPTION = "Key size is not valid. Key size must be: ";
// 
// }
// 
// Path: encoder/src/main/java/ru/bullyboo/encoder/methods/ARCFOUR.java
// public class ARCFOUR extends BaseMethod{
// 
//     /**
//      * ARCFOUR method
//      */
//     private static final String ARCFOUR = "ARCFOUR";
// 
//     /**
//      * Implementation of ARCFOUR encryption
//      */
//     public static String encrypt(byte[] key, int keySize, byte[] message) throws Exception {
// 
// //        generate Key
//         byte[] keyBytes = generateKey(key, keySize);
//         SecretKeySpec keySpec = new SecretKeySpec(keyBytes, ARCFOUR);
// 
//         Cipher cipher = Cipher.getInstance(ARCFOUR);
//         cipher.init(Cipher.ENCRYPT_MODE, keySpec);
//         byte[] cipherText = cipher.doFinal(message);
// 
//         return Base64.encodeToString(cipherText, Base64.DEFAULT);
//     }
// 
//     /**
//      * Implementation of ARCFOUR decryption
//      */
//     public static String decrypt(byte[] key, int keySize, byte[] message) throws Exception {
// 
// //        generate Key
//         byte[] keyBytes = generateKey(key, keySize);
//         SecretKeySpec keySpec = new SecretKeySpec(keyBytes, ARCFOUR);
// 
//         Cipher cipher = Cipher.getInstance(ARCFOUR);
//         cipher.init(Cipher.ENCRYPT_MODE, keySpec);
//         byte[] cipherText = cipher.doFinal(Base64.decode(message, Base64.DEFAULT));
// 
//         return new String(cipherText);
//     }
// }


// Path: encoder/src/main/java/ru/bullyboo/encoder/builders/BuilderARCFOUR.java
import ru.bullyboo.encoder.constants.Constants;
import ru.bullyboo.encoder.methods.ARCFOUR;

    public BuilderARCFOUR key(String key, int keySize) {
        this.key = key.getBytes();
        this.keySize = keySize;
        return this;
    }

    public BuilderARCFOUR key(byte[] key, int keySize) {
        this.key = key;
        this.keySize = keySize;
        return this;
    }

    public BuilderARCFOUR keySize(int keySize) {
        this.keySize = keySize;
        return this;
    }

    @Override
    String encryption() throws Exception {
        return ARCFOUR.encrypt(key, keySize, message);
    }

    @Override
    String decryption() throws Exception {
        return ARCFOUR.decrypt(key, keySize, message);
    }

    @Override
    boolean hasEnoughData() {
        if(message == null){
            throw new NullPointerException(Constants.MESSAGE_EXCEPTION);