Beispiel #1
0
 private void btnTestSubpass_Click(object sender, EventArgs e)
 {
     if (testSubPassword(FrmInputPassword.Input(this, "请输入其中一个子密码")) != "")
     {
         MessageBox.Show("子密码认证成功");
     }
     else
     {
         MessageBox.Show("子密码错误或不存在");
     }
 }
Beispiel #2
0
 private void btnClearSubpass_Click(object sender, EventArgs e)
 {
     if (Form1.cryptor.verifyPassword(FrmInputPassword.Input(this, "请输入主密码确认操作")))
     {
         appSettingObject.subpasswords.Clear();
     }
     else
     {
         MessageBox.Show("主密码错误");
     }
     loadSubPass();
 }
Beispiel #3
0
 private void btnNewSubpass_Click(object sender, EventArgs e)
 {
     MessageBox.Show("添加子密码后,通过子密码可以修改名单。");
     if (Form1.cryptor.verifyPassword(FrmInputPassword.Input(this, "请输入主密码")))
     {
         string subpass = FrmInputPassword.CreatePassword(this);
         if (null == subpass)
         {
             return;
         }
         appSettingObject.subpasswords.Add(FinanceCrypto.CryptoHelper.AesEncrypt("MAINPASS" + FinanceCrypto.CryptoObject.randomMask() + savepassword, subpass));
     }
     else
     {
         MessageBox.Show("主密码错误");
     }
     loadSubPass();
 }
Beispiel #4
0
 private void btnChpwd_Click(object sender, EventArgs e)
 {
     if (Form1.cryptor.verifyPassword(FrmInputPassword.Input(this, "请输入旧密码")))
     {
         savepassword = FrmInputPassword.CreatePassword(this);
         if (null == savepassword)
         {
             return;
         }
         appSettingObject.subpasswords.Clear();
         Form1.cryptor.init(savepassword);
         Form1.cryptor.setData(JsonConvert.SerializeObject(appSettingObject), savepassword);
     }
     else
     {
         MessageBox.Show("主密码错误");
     }
     loadSubPass();
 }
Beispiel #5
0
        private void btnSetting_Click(object sender, EventArgs e)
        {
            string password = FrmInputPassword.Input(this, "请输入密码");

            if (cryptor.verifyPassword(password))
            {
                openSetting(password);
                return;
            }
            else
            {
                password = testSubPassword(password);
                if (password != "")
                {
                    openSetting(password);
                    return;
                }
            }
            MessageBox.Show("密码错误");
        }
Beispiel #6
0
        private void btnSecurityCheck_Click(object sender, EventArgs e)
        {
            string password = FrmInputPassword.Input(this, "请输入密码");

            if (!cryptor.verifyPassword(password))
            {
                password = testSubPassword(password);
            }
            if (!cryptor.verifyPassword(password))
            {
                MessageBox.Show("密码错误");
                return;
            }
            if (cryptor.verifyData(password))
            {
                MessageBox.Show("数据校验成功,可以放心使用");
            }
            else
            {
                MessageBox.Show("数据校验失败,名单可能已经被篡改", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }