encrypt and sign