Improvement: Support authorize master online

This commit is contained in:
yuanyuanxiang
2025-06-14 23:40:11 +08:00
parent f4364a4368
commit f1cf45dd3b
17 changed files with 332 additions and 37 deletions

View File

@@ -1,5 +1,18 @@
#ifdef _WINDOWS
#include "stdafx.h"
#else
#include <windows.h>
#define Mprintf
#endif
#include "pwd_gen.h"
#include <vector>
#include <sstream>
#include <iomanip>
#include <wincrypt.h>
#include <iostream>
#include "common/commands.h"
#pragma comment(lib, "Advapi32.lib")
@@ -115,3 +128,10 @@ std::string getFixedLengthID(const std::string& hash) {
std::string deriveKey(const std::string& password, const std::string& hardwareID) {
return hashSHA256(password + " + " + hardwareID);
}
std::string getDeviceID() {
std::string hardwareID = getHardwareID();
std::string hashedID = hashSHA256(hardwareID);
std::string deviceID = getFixedLengthID(hashedID);
return deviceID;
}