|
@@ -0,0 +1,26 @@
|
|
|
|
+#include <QCoreApplication>
|
|
|
|
+#include "QDebug"
|
|
|
|
+int main(int argc, char *argv[])
|
|
|
|
+{
|
|
|
|
+ QCoreApplication a(argc, argv);
|
|
|
|
+ QString str="640d0df56d6g876cc1d0c49c99h4156c";
|
|
|
|
+ QString decryptedText;
|
|
|
|
+ for (int i = 0; i < str.length(); ++i) {
|
|
|
|
+ QChar currentChar = str.at(i);
|
|
|
|
+ if (currentChar.isLetter()) {
|
|
|
|
+ QChar decryptedChar = (currentChar.toLatin1() - 'a' - 2 + 26) % 26 + 'a'; // 反解密操作
|
|
|
|
+ if (currentChar.isUpper()) {
|
|
|
|
+ decryptedChar = (currentChar.toLatin1() - 'A' - 2 + 26) % 26 + 'A'; // 如果是大写字母
|
|
|
|
+ }
|
|
|
|
+ decryptedText.append(decryptedChar);
|
|
|
|
+ } else if (currentChar.isDigit()) {
|
|
|
|
+ QChar decryptedChar = (currentChar.toLatin1() - '0' - 4 + 10) % 10 + '0'; // 反解密操作
|
|
|
|
+ decryptedText.append(decryptedChar);
|
|
|
|
+ } else {
|
|
|
|
+ decryptedText.append(currentChar); // 如果不是字母或数字,则保持不变
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ qDebug()<< decryptedText;
|
|
|
|
+
|
|
|
|
+ return a.exec();
|
|
|
|
+}
|