update encrypt and decrypt function