adding encrypt and decrypt functions