start of encrypt and decrypt