32 lines
770 B
C++
32 lines
770 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <stdint.h>
|
|
|
|
class key
|
|
{
|
|
public:
|
|
key();
|
|
~key();
|
|
//std::string get_gts_sn(void) { return m_gts_sn; }
|
|
//std::string get_rtc_sn(void) { return m_rtc_sn; }
|
|
//std::string get_hd_sn(void) { return m_hd_sn; }
|
|
void InitKey();
|
|
std::string get_key(const uint8_t * crypt = nullptr);
|
|
uint8_t * get_crypt(void);
|
|
void aes_encrypt(uint8_t *data);
|
|
void aes_decrypt(uint8_t *data);
|
|
|
|
private:
|
|
const uint8_t crypt_key[17] = "Zdcf&mZXfNZZJ%yn";
|
|
uint8_t * m_crypt = nullptr;
|
|
std::string m_key;
|
|
std::string m_gts_sn; // 固高卡的版本
|
|
std::string m_rtc_sn; // ScanLab的RTC卡的序列号
|
|
std::string m_hd_sn; // 硬盘序列号
|
|
std::string gen_gts_sn(void);
|
|
std::string gen_rtc_sn(void);
|
|
std::string gen_hd_sn(void);
|
|
};
|