When I call the Encrypt function from this PB dll from another Windows application all I receive is the "C" but I should be receiving the entire encrypted string. Can someone tell me what I have done wrong?
Code: Select all
;
; AES Encryption key and Initialization Vector
;
DataSection
Key:
Data.b $25, $64, $24, $47, $7D, $BC, $80, $BF, $2B, $7A, $72, $2A, $29, $41, $6E, $2B, $4B, $23, $5E, $75, $65, $34, $3D, $70, $43, $3F, $3B, $49, $6A, $36, $51, $30
IV:
Data.b $3d, $af, $ba, $42, $9d, $9e, $b4, $30, $b4, $22, $da, $80, $2c, $9f, $ac, $41
EndDataSection
Global gcEnc.s
ProcedureDLL.s Encrypt(tcTxt.s)
Define lcTxt2.s
If Len(tcTxt) < 16
tcTxt = LSet(tcTxt,16," ")
EndIf
lcTxt2 = Space(1024)
AESEncoder(@tcTxt,@lcTxt2,StringByteLength(tcTxt),?Key,256,?IV,#PB_Cipher_CBC)
lcTxt2 = RTrim(lcTxt2)
gcEnc = Base64Encoder(@lcTxt2,StringByteLength(lcTxt2))
ProcedureReturn gcEnc
EndProcedure


