public void GetPublicKeys(out int generator, out int primeModulus) { generator = m_sharedKeyGenerator.GetGenerator(); primeModulus = m_sharedKeyGenerator.GetPrimeModulus(); m_secureState = eSecureState.AWAITING_RESPONSE; }
/* Function that finalize the channel security by generating the private encryption key that * the other party will also be able to generate. * * It result in both parties having the same encryption key without eavesdropper knowing. */ public void CompleteSecuringChannel(int otherPublicData) { int sharedKey = m_sharedKeyGenerator.GetFinalPrivateSharedKey(otherPublicData); m_encryptionKey = F3_SHA256.GetHash(sharedKey.ToString()); m_secureState = eSecureState.SECURED; }