presto-main/src/main/java/io/prestosql/spiller/AesSpillCipher.java/AesSpillCipher/encrypt
class AesSpillCipher:    @Override
    public int encrypt(byte[] data, int inputOffset, int length, byte[] destination, int destinationOffset)
    {
        checkArgument(data.length - inputOffset >= length, "data buffer too small for length argument");
        checkArgument(destination.length - destinationOffset >= encryptedMaxLength(length), "destination buffer too small for encrypted output");
        Cipher cipher = createEncryptCipher(key);
        System.arraycopy(cipher.getIV(), 0, destination, destinationOffset, ivBytes);
        try {
            return ivBytes + cipher.doFinal(data, inputOffset, length, destination, destinationOffset + ivBytes);
        }
        catch (GeneralSecurityException e) {
            throw new PrestoException(GENERIC_INTERNAL_ERROR, "Failed to encrypt data: " + e.getMessage(), e);
        }
    }