20 lines
685 B
C++
20 lines
685 B
C++
#include <iostream>
|
|||
|
|
#include "src/core/models/account.h"
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
QString original = "mySecretPassword123!";
|
||
|
|
QString encrypted = Account::encryptPassword(original);
|
||
|
|
QString decrypted = Account::decryptPassword(encrypted);
|
||
|
|
|
||
|
|
std::cout << "Original: " << original.toStdString() << std::endl;
|
||
|
|
std::cout << "Encrypted: " << encrypted.toStdString() << std::endl;
|
||
|
|
std::cout << "Decrypted: " << decrypted.toStdString() << std::endl;
|
||
|
|
|
||
|
|
if (decrypted == original) {
|
||
|
|
std::cout << "SUCCESS: Encryption/decryption round-trip matches." << std::endl;
|
||
|
|
return 0;
|
||
|
|
} else {
|
||
|
|
std::cout << "FAIL: mismatch." << std::endl;
|
||
|
|
return 1;
|
||
|
|
}
|
||
|
|
}
|