Added function for transmitting an encrypted payload