• 1397/02/25

سوال :

Password = FormsAuthentication.HashPasswordForStoringInConfigFile(register.Password, "MD5"),

من الان \ارت ۴ هستم جناب مداءنی و موقع هشتگ کردن password یه خط سبز رنگ زیر کد بالا میاد و پیغام میده که

formsAuthnetication.HashPasswordForStroing is is obsolete.

ایراد از چیه؟

  • 1397/02/25
  • ساعت 09:30

بله میگه این الگوریتم امن نیست

یادم رفت در ویدئو بگم از متد زیر استفاده کنید

       public static string EncodePasswordMd5(string pass) //Encrypt using MD5   
        {
            Byte[] originalBytes;
            Byte[] encodedBytes;
            MD5 md5;
            //Instantiate MD5CryptoServiceProvider, get bytes for original password and compute hash (encoded password)   
            md5 = new MD5CryptoServiceProvider();
            originalBytes = ASCIIEncoding.Default.GetBytes(pass);
            encodedBytes = md5.ComputeHash(originalBytes);
            //Convert encoded bytes back to a 'readable' string   
            return BitConverter.ToString(encodedBytes);
        }

 


logo-enamadlogo-samandehi