rewrite data encrypt and compress modules