@Test
    public void testGetAndPutByteFiles() {
        System.out.println("Put Plaintext, get Plainfile, encrypt and decrypt Byte Files");
        for (int i = 1; i < 100; i += 3) {
            String filePathPlain = "target/test.txt";
            String filePathEnc = "target/test.cty";
            String filePathDec = "target/test2.txt";
            int keySize = 1024;
            byte[] testString = new byte[i*100+i];
            new Random().nextBytes(testString);

            CryptobyClient client = new CryptobyClient();
            CryptobyCore core = new CryptobyCore(client);
            CryptRSA rsa = new CryptRSA();
            KeyGenRSA generator = new KeyGenRSA(core);

            try {
                CryptobyFileManager.putBytesToFile(filePathPlain, testString);
            } catch (IOException ex) {
                Logger.getLogger(CryptobyFileManagerTest.class.getName()).log(Level.SEVERE, null, ex);
            }

            generator.initGenerator(keySize);
            byte[] publicKey = generator.getPublicKeyByte();
            byte[] privateKey = generator.getPrivateKeyByte();
            byte[] plainInput = null;
            try {
                plainInput = CryptobyFileManager.getBytesFromFile(filePathPlain);
            } catch (IOException ex) {
                Logger.getLogger(CryptobyFileManagerTest.class.getName()).log(Level.SEVERE, null, ex);
            }

            byte[] encrypt = rsa.encrypt(plainInput, publicKey);
            try {
                CryptobyFileManager.putBytesToFile(filePathEnc, encrypt);
            } catch (IOException ex) {
                Logger.getLogger(CryptobyFileManagerTest.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                encrypt = CryptobyFileManager.getBytesFromFile(filePathEnc);
            } catch (IOException ex) {
                Logger.getLogger(CryptobyFileManagerTest.class.getName()).log(Level.SEVERE, null, ex);
            }

            byte[] decrypt = rsa.decrypt(encrypt, privateKey);
            try {
                CryptobyFileManager.putBytesToFile(filePathDec, decrypt);
            } catch (IOException ex) {
                Logger.getLogger(CryptobyFileManagerTest.class.getName()).log(Level.SEVERE, null, ex);
            }

            assertArrayEquals(testString, decrypt);
        }
    }