added encrypt/decrypt logic