Example #1
0
        public async Task StartDHSession()
        {
            String EncryptedClientNumber = AesEncryption.AES_Encrypt(GeneratoreMachine.GetClientPublicNumber(),
                                                                     SymmetricKey.StrKeyBase64);

            String HmacHash = MacAlgProvider.CreateHMAC(EncryptedClientNumber, SymmetricKey.StrKeyBase64);

            WriteObj.setClientEncryptedPrimeNumber(EncryptedClientNumber);
            WriteObj.setHmacHash(HmacHash);



            WriteObj.setEncryptedSymetricClientKey(RsaEncryption.RsaEncrypt(
                                                       SymmetricKey.StrKeyBase64,
                                                       ReadObj.getRSAPublicKey())
                                                   );


            String StringTOsentWithRsa = JsonParse.WriteObject(WriteObj);

            await ActivitySocket.send(StringTOsentWithRsa);
        }