Ejemplo n.º 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);
        }
        public static bool checkLogin1(string masv, string psw)
        {
            string psw1 = PasswordUtil.HashPassword(psw);

            using (SqlConnection objConnection = Nuce_Common.GetConnection())
            {
                if (objConnection == null)
                {
                    return(false);
                }
                try
                {
                    //Execute select command
                    string    strSql = string.Format(@"select 1 from [dbo].[dnn_Nuce_Eduweb_sv_pass] where [masv]='{0}' and [pass]='{1}' ", masv, psw1);
                    DataTable dt     = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(objConnection, CommandType.Text, strSql).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                catch
                {
                    return(false);
                }
            }
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
 private static string CreatePasswordHash(string pwd, string salt)
 {
     return(PasswordUtil.HashPassword(pwd));
 }