add encrypt/decrypt function