Files
SimpleRemoter/server/2015Remote/pwd_gen.h
2025-12-06 11:56:46 +01:00

25 lines
643 B
C++

#pragma once
#include <string>
typedef std::string(*fallback)();
// 对生成服务端功能进行加密
std::string getHardwareID(fallback fb = NULL);
std::string hashSHA256(const std::string& data);
std::string genHMAC(const std::string& pwdHash, const std::string& superPass);
std::string getFixedLengthID(const std::string& hash);
std::string deriveKey(const std::string& password, const std::string& hardwareID);
std::string getDeviceID(fallback fb = NULL);
// Use HMAC to sign a message.
uint64_t SignMessage(const std::string& pwd, BYTE* msg, int len);
bool VerifyMessage(const std::string& pwd, BYTE* msg, int len, uint64_t signature);