Changeset View
Changeset View
Standalone View
Standalone View
src/cipher.cpp
Show All 33 Lines | 22 | { | |||
---|---|---|---|---|---|
34 | 34 | | |||
35 | Cipher::Cipher(QByteArray key, QString cipherType) | 35 | Cipher::Cipher(QByteArray key, QString cipherType) | ||
36 | { | 36 | { | ||
37 | m_primeNum = QCA::BigInteger("12745216229761186769575009943944198619149164746831579719941140425076456621824834322853258804883232842877311723249782818608677050956745409379781245497526069657222703636504651898833151008222772087491045206203033063108075098874712912417029101508315117935752962862335062591404043092163187352352197487303798807791605274487594646923"); | 37 | m_primeNum = QCA::BigInteger("12745216229761186769575009943944198619149164746831579719941140425076456621824834322853258804883232842877311723249782818608677050956745409379781245497526069657222703636504651898833151008222772087491045206203033063108075098874712912417029101508315117935752962862335062591404043092163187352352197487303798807791605274487594646923"); | ||
38 | setKey(key); | 38 | setKey(key); | ||
39 | setType(cipherType); | 39 | setType(cipherType); | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | Cipher::~Cipher() | 42 | Cipher::~Cipher() = default; | ||
43 | { | | |||
44 | } | | |||
45 | 43 | | |||
46 | bool Cipher::setKey(QByteArray key) | 44 | bool Cipher::setKey(QByteArray key) | ||
47 | { | 45 | { | ||
48 | if(key.isEmpty()) | 46 | if(key.isEmpty()) | ||
49 | return false; | 47 | return false; | ||
50 | 48 | | |||
51 | if(key.mid(0,4).toLower() == "ecb:") | 49 | if(key.mid(0,4).toLower() == "ecb:") | ||
52 | { | 50 | { | ||
▲ Show 20 Lines • Show All 465 Lines • Show Last 20 Lines |