2019-12-18 10:27:34 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace KRY_0x04
|
|
|
|
|
{
|
|
|
|
|
public partial class Form1 : Form
|
|
|
|
|
{
|
|
|
|
|
public Form1()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 04:51:15 +01:00
|
|
|
|
LogicHandler lh = new LogicHandler();
|
2019-12-18 10:27:34 +01:00
|
|
|
|
|
2019-12-18 13:44:57 +01:00
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void load_msg_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* load msg */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.load_msg(msgbox, msgpathbox, msgdetailsbox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void save_msg_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* save msg */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.save_msg(msgbox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void compute_sha_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* compute sha256 */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.compute_sha256(msgpathbox, computedshabox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void load_privkey_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* load privkey */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.load_privkey(privkeybox, privkeypathbox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void load_pubkey_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* load pubkey */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.load_pubkey(pubkeybox, pubkeypathbox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void save_sha_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* save sha256sum */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.save_sha256(computedshabox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void load_sha_button_Click(object sender, EventArgs e)
|
2019-12-18 10:27:34 +01:00
|
|
|
|
{
|
|
|
|
|
/* load sha256 */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.load_sha256(loadedshabox);
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
2019-12-18 11:26:59 +01:00
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void zip_button_Click(object sender, EventArgs e)
|
2019-12-18 11:26:59 +01:00
|
|
|
|
{
|
|
|
|
|
/* zip */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.do_zip(msgbox, msgpathbox);
|
2019-12-18 11:26:59 +01:00
|
|
|
|
}
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void unzip_button_Click(object sender, EventArgs e)
|
2019-12-18 11:26:59 +01:00
|
|
|
|
{
|
|
|
|
|
/* unzip */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.do_unzip();
|
2019-12-18 13:44:57 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void sign_button_Click(object sender, EventArgs e)
|
2019-12-18 13:44:57 +01:00
|
|
|
|
{
|
2021-01-10 04:51:15 +01:00
|
|
|
|
/* sign */
|
|
|
|
|
lh.do_sign(msgbox, privkeybox, pubkeybox, computedshabox);
|
2019-12-18 11:26:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void verify_button_Click(object sender, EventArgs e)
|
2019-12-18 13:44:57 +01:00
|
|
|
|
{
|
|
|
|
|
/* verify */
|
2021-01-10 04:51:15 +01:00
|
|
|
|
lh.do_verify(pubkeybox);
|
2019-12-18 13:44:57 +01:00
|
|
|
|
}
|
2020-01-27 04:44:19 +01:00
|
|
|
|
|
2021-01-10 00:30:07 +01:00
|
|
|
|
private void cleanALL_button_Click(object sender, EventArgs e)
|
2020-01-27 04:44:19 +01:00
|
|
|
|
{
|
2021-01-10 00:23:19 +01:00
|
|
|
|
msgpathbox.Text = "";
|
|
|
|
|
loadedshabox.Text = "";
|
|
|
|
|
computedshabox.Text = "";
|
|
|
|
|
msgdetailsbox.Text = "";
|
|
|
|
|
privkeypathbox.Text = "";
|
|
|
|
|
pubkeypathbox.Text = "";
|
|
|
|
|
msgbox.Text = "";
|
|
|
|
|
privkeybox.Text = "";
|
|
|
|
|
pubkeybox.Text = "";
|
2020-01-27 04:44:19 +01:00
|
|
|
|
}
|
2019-12-18 10:27:34 +01:00
|
|
|
|
}
|
|
|
|
|
}
|