added decrypt and encrypt functionality