added encrypt and decrypt message wrapper function