public void encryptFile(String filePath, byte[][][] subKeys) {
        System.out.println();
        System.out.println("Encrypting");

        try {
            final File inputFile = new File(filePath);
            final File outputFile = new File(filePath + ".des");
            final InputStream inputStream = new BufferedInputStream(new FileInputStream(inputFile));
            final OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(outputFile));

            final long nbBytesFile = inputFile.length();
            final long nbTotalBlocks = (long) Math.ceil(nbBytesFile / (double) BLOCK_SIZE_IN_BYTES);
            final int nbBytesPaddingNeeded = (int) (BLOCK_SIZE_IN_BYTES - (nbBytesFile % BLOCK_SIZE_IN_BYTES));

            final byte header = (byte) nbBytesPaddingNeeded;
            outputStream.write(header);

            byte[] block = new byte[BLOCK_SIZE_IN_BYTES];
            int bytesRead = 0;

            for (long nbBlocks = 1; nbBlocks <= nbTotalBlocks; nbBlocks++) {

                bytesRead = inputStream.read(block);

                //System.out.println("Encrypting block " + nbBlocks);
                byte[] encryptedBlock = DesAlgorithm.encryptBlock(block, subKeys);

                // schrijf geencrypteerd blok weg naar output bestand
                outputStream.write(encryptedBlock);

                block = new byte[BLOCK_SIZE_IN_BYTES];
            }

            inputStream.close();
            outputStream.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }