Org.Mentalis.Security.Cryptography.DiffieHellman.DecryptKeyExchange C# (CSharp) Method

DecryptKeyExchange() public abstract method

When overridden in a derived class, extracts secret information from the key exchange data.
public abstract DecryptKeyExchange ( byte keyEx ) : byte[]
keyEx byte The key exchange data within which the secret information is hidden.
return byte[]
		public abstract byte[] DecryptKeyExchange(byte[] keyEx);

Usage Example

Esempio n. 1
0
		public static byte[] SHAHashXorSecret(HashAlgorithm hasher, DiffieHellman dh, byte[] keyEx, byte[] encMacKey) {
			byte[] dhShared = dh.DecryptKeyExchange(keyEx);
			byte[] shaDhShared = hasher.ComputeHash(ensurePositive(dhShared));
			if (shaDhShared.Length != encMacKey.Length) {
				throw new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture,
					"encMacKey's length ({0}) does not match the length of the hashing algorithm ({1}).",
					encMacKey.Length, shaDhShared.Length));
			}

			byte[] secret = new byte[encMacKey.Length];
			for (int i = 0; i < encMacKey.Length; i++) {
				secret[i] = (byte)(encMacKey[i] ^ shaDhShared[i]);
			}
			return secret;
		}
All Usage Examples Of Org.Mentalis.Security.Cryptography.DiffieHellman::DecryptKeyExchange