{"action":"opened","issue":{"url":"https://api.github.com/repos/FICTURE7/CoCSharp/issues/90","repository_url":"https://api.github.com/repos/FICTURE7/CoCSharp","labels_url":"https://api.github.com/repos/FICTURE7/CoCSharp/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/FICTURE7/CoCSharp/issues/90/comments","events_url":"https://api.github.com/repos/FICTURE7/CoCSharp/issues/90/events","html_url":"https://github.com/FICTURE7/CoCSharp/issues/90","id":186109552,"number":90,"title":"CoCSharp.Client 8.x encryption support","user":{"login":"fivedashthree","id":14157677,"avatar_url":"https://avatars.githubusercontent.com/u/14157677?v=3","gravatar_id":"","url":"https://api.github.com/users/fivedashthree","html_url":"https://github.com/fivedashthree","followers_url":"https://api.github.com/users/fivedashthree/followers","following_url":"https://api.github.com/users/fivedashthree/following{/other_user}","gists_url":"https://api.github.com/users/fivedashthree/gists{/gist_id}","starred_url":"https://api.github.com/users/fivedashthree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fivedashthree/subscriptions","organizations_url":"https://api.github.com/users/fivedashthree/orgs","repos_url":"https://api.github.com/users/fivedashthree/repos","events_url":"https://api.github.com/users/fivedashthree/events{/privacy}","received_events_url":"https://api.github.com/users/fivedashthree/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-30T00:42:45Z","updated_at":"2016-10-30T00:42:45Z","closed_at":null,"body":"The CoCSharp.Client project hasn't been updated for nearly a year and won't work with the new encryption system. \r\n\r\nI've started writing a new client, but I can't quite get the encryption right. The CoCSharp library seems to only have partial support for client -> server communication. \r\n\r\n[Here's what I have so far](http://pastebin.com/uc47BXLP). I'm sucessfully sending 10100 and getting 20100 in return, but I get no reply after sending 10101, which suggests that the message is not even being read, so probably bad encryption.\r\n\r\nHere's the relevant part of the code:\r\n` HandshakeSuccessMessage reply = (HandshakeSuccessMessage)Messages.Dequeue();\r\n            byte[] SessionKey = reply.SessionKey;\r\n\r\n            //Generate nonce and client keys\r\n            byte[] snonce = Crypto8.GenerateNonce();\r\n\r\n            CoCKeyPair pksk = Crypto8.GenerateKeyPair();\r\n            byte[] pk = pksk.PrivateKey;\r\n            byte[] sk = pksk.PublicKey;\r\n \r\n            //byte[] nonce = Crypto8.GenerateBlake2BNonce(pk, Crypto8.SupercellPublicKey);\r\n            crypto.UpdateSharedKey(Crypto8.SupercellPublicKey);\r\n \r\n            crypto.UpdateNonce(snonce, UpdateNonceType.Blake);\r\n            crypto.UpdateNonce(snonce, UpdateNonceType.Encrypt);\r\n \r\n            //Send LoginRequestMessage (id: 10101)`\r\n\r\nI'm trying to follow the [Protocol page on clugh's wiki](https://github.com/clugh/cocdp/wiki/Protocol), but I'm not sure where I plug in the client-generated `pk `and `sk `keys from step 6. \r\n\r\nI'm fairly certain that I'm doing something wrong there, but if that's not the issue, CoCSharp doesnt seem to have proper support for sending message 10101 anyway, as it needs to be prefixed with the client's `pk` after encryption. "}}
{"actor":{"display_login":"fivedashthree"}}