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; // <20≯߿<CCB8><DFBF>İ汾
|
|||
|
std::string m_rtc_sn; // ScanLab<61><62>RTC<54><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
|
|||
|
std::string m_hd_sn; // Ӳ<><D3B2><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
|
|||
|
std::string gen_gts_sn(void);
|
|||
|
std::string gen_rtc_sn(void);
|
|||
|
std::string gen_hd_sn(void);
|
|||
|
};
|