forked from LazyT/rrcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
converter.cpp
28 lines (21 loc) · 872 Bytes
/
converter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "converter.h"
converterDialog::converterDialog(QWidget *parent) : QDialog(parent)
{
setupUi(this);
layout()->setSizeConstraint(QLayout::SetFixedSize);
setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
lineEdit_96->setValidator(new QRegExpValidator(QRegExp("[0-9a-fA-F]{96}")));
}
void converterDialog::on_lineEdit_96_textChanged(QString text)
{
lineEdit_96->setText(lineEdit_96->text().toUpper());
lineEdit_32->setText(QAESEncryption::Decrypt(QAESEncryption::AES_128, QAESEncryption::ECB, QByteArray::fromHex(text.left(64).toUtf8()), QByteArray::fromHex("00000000000000000000000000000000")).toUpper());
}
void converterDialog::on_lineEdit_16_textChanged(QString text)
{
lineEdit_32->setText(text.toUtf8().toHex().toUpper());
}
void converterDialog::on_buttonBox_clicked(__attribute__((unused)) QAbstractButton *button)
{
close();
}