protected void btnPwd_Click(object sender, EventArgs e) { string slt = BCrypt.Net.BCrypt.GenerateSalt(15); RndPwd rnd = new RndPwd(); string pwd = rnd.Generate(30); string hp = BCrypt.Net.BCrypt.HashPassword(pwd, slt); //lblpwd.Text = hp + "<br />" + pwd; }
/// <summary> /// Generate random password /// </summary> /// <returns></returns> public string genPass() { string rtn = ""; string slt = BCrypt.Net.BCrypt.GenerateSalt(15); RndPwd rnd = new RndPwd(); string pwd = rnd.Generate(12,30); string hp = BCrypt.Net.BCrypt.HashPassword(pwd, slt); return rtn; }