Sto usando la nuova versione di ASP.NET MVC 6 (ASP.NET 5). Se il mio obiettivo è il framework .NET CoreCLR (ASP.NET Core), il codice non viene compilato perché sto utilizzando MD5CryptoServiceProvider
da System.Security.Cryptography
. Potete suggerire eventuali alternative che si compilano con il framework CoreCLR?Alternative di MD5CryptoServiceProvider in CoreCLR (ASP.NET 5 Core)
8
A
risposta
12
Utilizzare MD5.Create()
dal pacchetto
. System.Security.Cryptography.Hashing.Algorithms
System.Security.Cryptography.Algorithms
.
Aggiornamento System.Security.Cryptography.Hashing.Algorithms
è contrassegnato obsoleto al momento.
6
Aggiornamento a Victor Hurdugaci's answer: utilizzare il pacchetto System.Security.Cryptography.Algorithms
.
System.Security.Cryptography.Hashing.Algorithms
è contrassegnato come obsoleto al momento.
5
Per hash incrementale, in System.Security.Cryptography
:
using (IncrementalHash hasher = IncrementalHash.CreateHash(HashAlgorithmName.MD5))
{
//hash loop
hasher.AppendData(data);
hasher.AppendData(data);
hasher.AppendData(data);
byte[] hash = hasher.GetHashAndReset();
}
Ciao, v'è un'implementazione di System.Security.Cryptography.ICryptoTransform per MD5 in nucleo dotnet da utilizzare con il CryptoStream? Vorrei leggere un flusso e scrivere su più flussi, compresi i flussi hash incrementali calcolati ... – Dede
Trovato: System.Security.Cryptography.IncrementalHash.Create (HashAlgorithmName.MD5) – Dede