MD5 md5 = MD5.Create();
byte[] Ostring = System.Text.Encoding.UTF8.GetBytes("original string");
byte[] hashMD5 = md5.ComputeHAsh(Ostring);
StringBuilder sb = new StringBuilder();
for (int i=0; i<hashMD5.Length; i++)
{
sb.Append(hashMD5[i].ToString("X2"));
}
string strMD5 = sb.ToString();
la valeur de strMD5 Je veux chiffrer, en utilisant l'algorithme RSA avec une clé au format DER « fichier: aa.key »Comment je peux crypter une chaîne dans C#?
Comment puis-je faire en C#?
Ne pas utiliser MD5. – SLaks
Je pense que @SLaks suggère que vous devriez utiliser SHA-1 plutôt que MD5. –
@Jim: N'utilisez pas non plus SHA-1. ** UTILISEZ SHA-512 **! – SLaks