MD5 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示抽象類別 (Abstract Class),MD5 雜湊演算法的所有實作 (Implementation) 從它繼承。
public ref class MD5 abstract : System::Security::Cryptography::HashAlgorithm
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public abstract class MD5 : System.Security.Cryptography.HashAlgorithm
public abstract class MD5 : System.Security.Cryptography.HashAlgorithm
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class MD5 : System.Security.Cryptography.HashAlgorithm
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
type MD5 = class
inherit HashAlgorithm
type MD5 = class
inherit HashAlgorithm
[<System.Runtime.InteropServices.ComVisible(true)>]
type MD5 = class
inherit HashAlgorithm
Public MustInherit Class MD5
Inherits HashAlgorithm
- 繼承
- 衍生
- 屬性
哈希函式會將任意長度的二進位字串對應至固定長度的小型二進位字串。 密碼編譯哈希函式具有無法計算的 屬性,可尋找哈希為相同值的兩個相異輸入;也就是說,如果對應的數據也相符,則兩組數據的哈希應該相符。 對數據的小型變更會導致哈希中發生大型、無法預測的變更。
演算法的 MD5 哈希大小為128位。
類別 ComputeHash 的方法會以 16 個字節的 MD5 數位傳回哈希。 請注意,某些 MD5 實作會產生 32 個字元的十六進位格式哈希。 若要與這類實作互操作,請將方法的 ComputeHash 傳回值格式化為十六進位值。
注意
由於 MD5/SHA1 發生衝突問題,Microsoft 建議使用 SHA256 或 SHA512。 請考慮使用 SHA256 類別或 SHA512 類別,而不是類別 MD5 。 MD5僅用於與舊版應用程式和數據的相容性。
Hash |
MD5 演算法所產生的哈希大小,以位為單位。 |
Hash |
MD5 演算法所產生的哈希大小,以位元組為單位。 |
Hash |
代表計算出來之雜湊碼的大小,以位元為單位。 (繼承來源 HashAlgorithm) |
Hash |
表示計算出來的雜湊碼的值。 (繼承來源 HashAlgorithm) |
State |
表示雜湊計算的狀態。 (繼承來源 HashAlgorithm) |
Can |
取得值,表示目前的轉換是否可重複使用。 (繼承來源 HashAlgorithm) |
Can |
在衍生類別中覆寫時,取得值以指出是否有多個區塊可被轉換。 (繼承來源 HashAlgorithm) |
Hash |
取得計算出來之雜湊碼的值。 (繼承來源 HashAlgorithm) |
Hash |
取得計算出來之雜湊碼的大小,以位元為單位。 (繼承來源 HashAlgorithm) |
Input |
在衍生類別中覆寫時,取得輸入區塊的大小。 (繼承來源 HashAlgorithm) |
Output |
在衍生類別中覆寫時,取得輸出區塊的大小。 (繼承來源 HashAlgorithm) |
IDisposable. |
釋放 HashAlgorithm 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。 (繼承來源 HashAlgorithm) |
產品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.3, 1.4, 1.6, 2.0, 2.1 |