How to Encrypt the transmission between Client and Server(Unity3D and PhotonServer)

Options
I sent request by :“public virtual bool OpCustom(byte customOpCode, System.Collections.Generic.Dictionary customOpParameters, bool sendReliable)”

I found a
“public virtual bool OpCustom(byte customOpCode, System.Collections.Generic.Dictionary customOpParameters, bool sendReliable, byte channelId, bool encrypt)”.

There is "byte channelId" and "bool encrypt".
And I didnt found infomation about "What does this channel mean"
then i set channelid to (byte)1.and set encrypt true. then something went wrong:

ArgumentException: Can't use encryption yet. Exchange keys first.
ExitGames.Client.Photon.PhotonPeer.OpCustom (Byte customOpCode, System.Collections.Generic.Dictionary`2 customOpParameters, Boolean sendReliable, Byte channelId, Boolean encrypt)

what is the channel and the Exchange keys?
how to set it?

Best Answer

Answers

  • Django
    Django
    edited September 2017
    Options
    @JohnTube
    Thanks a lot~~~~
    Is there only AES(160bit)?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Yes for now we use 160 bit keys.