Exemple #1
0
        public static string AQDecoding(string chuoi)
        {
            string text = "";

            PasswordUtil.init();
            string result;

            for (int i = 0; i < chuoi.Length; i += 8)
            {
                string text2 = "";
                if (chuoi.Length % 8 != 0)
                {
                    result = "";
                    return(result);
                }
                for (int j = i; j < i + 8; j++)
                {
                    text2 += chuoi[j];
                }
                for (int k = 0; k <= 93; k++)
                {
                    if (text2.Equals(PasswordUtil.aqCode[k, 1]))
                    {
                        text += PasswordUtil.aqCode[k, 0];
                    }
                }
            }
            result = text;
            return(result);
        }
Exemple #2
0
        public static string AQEncoding(string t)
        {
            string text = "";

            PasswordUtil.init();
            for (int i = 0; i < t.Length; i++)
            {
                string text2 = "";
                for (int j = 0; j <= 93; j++)
                {
                    text2 += t[i];
                    if (PasswordUtil.aqCode[j, 0].Equals(text2))
                    {
                        text += PasswordUtil.aqCode[j, 1];
                    }
                    text2 = "";
                }
            }
            return(text);
        }
        public int authen(string masv, string pass)
        {
            string strConnectionString = ConfigurationManager.ConnectionStrings["eduwebConnectionString"].ConnectionString;
            //Execute select command
            string strSql = string.Format(@"SELECT count(MaND) 
  FROM [dbo].[NguoiDung] where MaND='{0}' and (MatKhau='{1}'
  or (exists (select  MaND from NguoiDungOnline where  MaND='{0}') and '{1}'='23fbf23c921b754adcb2fcac8e4b19b8a7c740'))", masv, PasswordUtil.HashPassword(pass));

            return((int)Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(strConnectionString, CommandType.Text, strSql));
        }
Exemple #4
0
 private static string CreatePasswordHash(string pwd, string salt)
 {
     return(PasswordUtil.HashPassword(pwd));
 }