HMAC HMAC HMAC HMAC Class
Represents the abstract class from which all implementations of Hash-based Message Authentication Code (HMAC) must derive.
public ref class HMAC abstract : System::Security::Cryptography::KeyedHashAlgorithm
[System.Runtime.InteropServices.ComVisible(true)] public abstract class HMAC : System.Security.Cryptography.KeyedHashAlgorithm
type HMAC = class inherit KeyedHashAlgorithm
Public MustInherit Class HMAC Inherits KeyedHashAlgorithm
A Hash-based Message Authentication Code (HMAC) can be used to determine whether a message sent over an insecure channel has been tampered with, provided that the sender and receiver share a secret key. The sender computes the hash value for the original data and sends both the original data and the HMAC as a single message. The receiver recomputes the hash value on the received message and checks that the computed hash value matches the transmitted hash value.
HMAC can be used with any iterative cryptographic hash function, such as MD5 or SHA-1, in combination with a secret shared key. The cryptographic strength of HMAC depends on the properties of the underlying hash function.
Any change to the data or the hash value results in a mismatch, because knowledge of the secret key is required to change the message and reproduce the correct hash value. Therefore, if the original and computed hash values match, the message is authenticated.
Due to collision problems with MD5 and SHA-1, Microsoft recommends a security model based on SHA-256 or better.
|HMAC() HMAC() HMAC() HMAC()||
Initializes a new instance of the HMAC class.
|BlockSizeValue BlockSizeValue BlockSizeValue BlockSizeValue||
Gets or sets the block size to use in the hash value.
|CanReuseTransform CanReuseTransform CanReuseTransform CanReuseTransform||
Gets a value indicating whether the current transform can be reused.(Inherited from HashAlgorithm)
|CanTransformMultipleBlocks CanTransformMultipleBlocks CanTransformMultipleBlocks CanTransformMultipleBlocks||
When overridden in a derived class, gets a value indicating whether multiple blocks can be transformed.(Inherited from HashAlgorithm)
|Hash Hash Hash Hash||
Gets the value of the computed hash code.(Inherited from HashAlgorithm)
|HashName HashName HashName HashName||
Gets or sets the name of the hash algorithm to use for hashing.
|HashSize HashSize HashSize HashSize||
Gets the size, in bits, of the computed hash code.(Inherited from HashAlgorithm)
|InputBlockSize InputBlockSize InputBlockSize InputBlockSize||
When overridden in a derived class, gets the input block size.(Inherited from HashAlgorithm)
|Key Key Key Key||
Gets or sets the key to use in the hash algorithm.
|OutputBlockSize OutputBlockSize OutputBlockSize OutputBlockSize||
When overridden in a derived class, gets the output block size.(Inherited from HashAlgorithm)
|HashSizeValue HashSizeValue HashSizeValue HashSizeValue||
Represents the size, in bits, of the computed hash code.(Inherited from HashAlgorithm)
|HashValue HashValue HashValue HashValue||
Represents the value of the computed hash code.(Inherited from HashAlgorithm)
|KeyValue KeyValue KeyValue KeyValue||
The key to use in the hash algorithm.(Inherited from KeyedHashAlgorithm)
|State State State State||
Represents the state of the hash computation.(Inherited from HashAlgorithm)
Explicit Interface Implementations
|IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()||
Releases the unmanaged resources used by the HashAlgorithm and optionally releases the managed resources.(Inherited from HashAlgorithm)