70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
{*******************************************************}
|
|
{ }
|
|
{ Tocsg.COLib.Encrypt }
|
|
{ }
|
|
{ Copyright (C) 2025 kku }
|
|
{ }
|
|
{*******************************************************}
|
|
|
|
unit Tocsg.COLib.Encrypt;
|
|
|
|
interface
|
|
|
|
uses
|
|
Tocsg.Obj, System.SysUtils, System.Classes, Winapi.Windows, Tocsg.COLib;
|
|
|
|
const
|
|
SIG_CO_DRM = 'ToCSG_CO';
|
|
SIG_CO_DRM_LEN = 8;
|
|
DRM_CO_VER = 1;
|
|
MAX_CO_HEAD_STR = 260;
|
|
|
|
type
|
|
PTgCoDrmHead = ^TTgCoDrmHead;
|
|
TTgCoDrmHead = packed record // LEN = 1768
|
|
pDEK: array [0..COLIB_256BIT_KEY_LEN-1] of Byte;
|
|
wVer: WORD;
|
|
dwCustomerCode: DWORD;
|
|
sSig: array [0..SIG_CO_DRM_LEN-1] of UTF8Char;
|
|
sFName,
|
|
sEmpNo,
|
|
sDeptName,
|
|
sHostName,
|
|
sReserve1,
|
|
sReserve2: array [0..MAX_CO_HEAD_STR-1] of UTF8Char;
|
|
sIpAddr: array [0..14] of PAnsiChar;
|
|
pSha256: array [0..SHA256_DIGEST_SIZE-1] of Byte;
|
|
cBlockKb: Byte;
|
|
cPad: Byte;
|
|
llEncDT: LONGLONG;
|
|
end;
|
|
|
|
function TGCO_Init(sLibDir: String; dwCCD: DWORD; sLicenseKey: String): Integer;
|
|
function TGCO_IsEncrypt(sPath: String): Boolean;
|
|
function TGCO_Encrypt(sSrcPath, sDstPath: String): Integer;
|
|
function TGCO_Decrypt(sSrcPath, sDstPath: String): Integer;
|
|
|
|
implementation
|
|
|
|
function TGCO_Init(sLibDir: String; dwCCD: DWORD; sLicenseKey: String): Integer;
|
|
begin
|
|
|
|
end;
|
|
|
|
function TGCO_IsEncrypt(sPath: String): Boolean;
|
|
begin
|
|
|
|
end;
|
|
|
|
function TGCO_Encrypt(sSrcPath, sDstPath: String): Integer;
|
|
begin
|
|
|
|
end;
|
|
|
|
function TGCO_Decrypt(sSrcPath, sDstPath: String): Integer;
|
|
begin
|
|
|
|
end;
|
|
|
|
end.
|