move check if a file should be encrypted to the pre hook