1.摘要算法
1.1 MD系列
1.1.1 MD5
Public Function MD5(body() As Byte) As Byte()
Dim oMD5 As Object
Set oMD5 = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider")
MD5 = oMD5.ComputeHash_2(body)
End Function
1.2 SHA系列
1.2.1 SHA1
Public Function SHA1(body() As Byte) As Byte()
Dim oSHA1 As Object
Set oSHA1 = CreateObject("System.Security.Cryptography.SHA1Managed")
SHA1 = oSHA1.ComputeHash_2(body)
End Function
1.2.2 SHA256
Public Function SHA256(body() As Byte) As Byte()
Dim oSHA256 As Object
Set oSHA256 = CreateObject("System.Security.Cryptography.SHA256Managed")
SHA256 = oSHA256.ComputeHash_2(body)
End Function
1.2.3 SHA384
Public Function SHA384(body() As Byte) As Byte()
Dim oSHA384 As Object
Set oSHA384 = CreateObject("System.Security.Cryptography.SHA384Managed")
SHA384 = oSHA384.ComputeHash_2(body)
End Function
1.2.4 SHA512
Public Function SHA512(body() As Byte) As Byte()
Dim oSHA512 As Object
Set oSHA512 = CreateObject("System.Security.Cryptography.SHA512Managed")
SHA512 = oSHA512.ComputeHash_2(body)
End Function
1.3 HMAC系列
1.3.1 HMAC-MD5
Public Function HmacMD5(body() As Byte, key() As Byte) As Byte()
Dim oHmacMD5 As Object
Set oHmacMD5 = CreateObject("System.Security.Cryptography.HMACMD5")
oHmacMD5.key = key
HmacMD5 = oHmacMD5.ComputeHash_2(body)
End Function
1.3.2 HMAC-SHA1
Public Function HmacSHA1(body() As Byte, key() As Byte) As Byte()
Dim oHmacSHA1 As Object
Set oHmacSHA1 = CreateObject("System.Security.Cryptography.HMACSHA1")
oHmacSHA1.key = key
HmacSHA1 = oHmacSHA1.ComputeHash_2(body)
End Function
1.3.3 HMAC-SHA256
Public