22 public abstract byte[]
H(
byte[] Data);
29 public virtual byte[]
H(
string s)
31 return this.
H(System.Text.Encoding.UTF8.GetBytes(s));
41 protected byte[]
HMAC(
byte[] Key,
byte[] Text)
48 Array.Resize(ref A1, 64);
50 byte[] A3 = (
byte[])A1.Clone();
53 for (i = 0; i < 64; i++)
68 protected byte[]
KD(
string k,
string s)
70 return this.
H(
CONCAT(k,
":", s));
Base class for all authentication mechanisms.
static byte[] CONCAT(params byte[][] Data)
Concatenates a sequence of byte arrays.
Base class for all hashed authentication mechanisms.
virtual byte[] H(string s)
Hash function
byte[] KD(string k, string s)
H(CONCAT(k:s))
HashedAuthenticationMechanism()
Base class for all hashed authentication mechanisms.
abstract byte[] H(byte[] Data)
Hash function
byte[] HMAC(byte[] Key, byte[] Text)
See RFC 2104 for a description of the HMAC algorithm: http://tools.ietf.org/html/rfc2104