public byte[] encrypt(Reference objectReference,
                          byte[] encryptionKey,
                          byte[] data) {

        // check if crypt filters are being used and find out if V2 or AESV2
        String algorithmType;
        if (encryptionDictionary.getCryptFilter() != null){
            CryptFilterEntry cryptFilterEntry =
                    encryptionDictionary.getCryptFilter().getCryptFilterByName(
                            encryptionDictionary.getStrF());

            algorithmType = cryptFilterEntry.getCryptFilterMethod().getName();
        } else{
            algorithmType = StandardEncryption.ENCRYPTION_TYPE_V2;
        }

        // use the general encryption algorithm for encryption
        return standardEncryption.generalEncryptionAlgorithm(
                objectReference, encryptionKey, algorithmType, data);
    }