DES3
3DES加解密函数

参数列表:

DES3

(

unsigned char cModel, 

unsigned char *pKey, 

unsigned char *In, 

unsigned char *Out

)


参数含义:

参数

类型

方向

含义

cModel

unsigned char

IN

加解密模式选择:

0x00->加密

0x01->解密

pkey

unsigned char*

IN

加解密密钥,16个字节

in

unsigned char*

IN

原始数据,8个字节

out

unsigned char*

OUT

加解密后的数据,8个字节


C++声明(VC++和C++ Builder):

int stdcall DES3(unsigned char cModel, unsigned char *pKey, unsigned char *In, unsigned char *Out);


Delphi声明:

function DES3(cModel:Byte;pkey: PChar;InData:PChar;OutData:PChar): Integer;stdcall;external YOWOREADERDLL;


VB声明:

Public Declare Function DES3 Lib "YW60x.dll" (ByVal cModel As Byte, ByRef pkey As Byte, ByRef InData As Byte, ByRef OutData As Byte) As Long


JAVA声明:

public int DES3(byte cModel, Pointer pKey, Pointer pInData, Pointer pOutData)

{

int ret;

try

{

JNative fuc = new JNative("YW60x.dll", "DES3");

fuc.setRetVal(Type.INT);

fuc.setParameter(0, cModel);

fuc.setParameter(1,pKey);

fuc.setParameter(2,pInData);

fuc.setParameter(3,pOutData);

fuc.invoke();

ret = fuc.getRetValAsInt();

}

catch(NativeException e)

{

ret = -1;

}

catch(IllegalAccessException e)

{

ret = -2;

}

return ret;

}


C#声明:

[DllImport("YW60x.dll")]

public static extern int DES3(byte cModel, byte [] pKey, byte [] pInData, byte [] pOutData);


Power Builder 9 声明:

public FUNCTION long DES3(char cModel, ref char pkey[], ref char InData[], ref char OutData[]) library "YW60x.dll"


支持的RFID读写器:
SDT-HA, YW-606PA, YW-606PB, YW-606PC, YW-605RA, YW-605RB, YW-605RC, YW-605SA, YW-605SB, YW-605SC, YW-605UA, YW-605UB, YW-605UC, YW-605HA, YW-605HB, YW-605HC, YW-620HA, YW-620HB, YW-620HC, YW-608RA, YW-608RB, YW-608RC, YW-608SA, YW-608SB, YW-608SC, YW-608UA, YW-608UB, YW-608UC, YW-608HA, YW-608HB, YW-608HC, YW-610SA, YW-610SB, YW-610SC, YW-602-R, YW-602-U, YW-602-3, YW-602-8, YW-652, YW-655, YW-657, YW-656, YW-607