我用的是pb的des64.dll里面的函数
ll_size = b64_size(LenA(ls_source),1)
ls_jiami = Space(ll_size)
b64_des(ls_source,ls_jiami,ls_key,LenA(ls_source),1)
对abcabc进行加密
密钥ls_key 是12345678
pb得出的数:h+Zh+ua48NM=
c#得出的数:7YdjOdeeR0g=
请问pb那个地方有问题?
pb的引用函数
Function int b64_size(ulong size,ulong flag) Library "des64.dll"
Function int b64_des(ref String in,ref string out,string key,ulong size,ulong flag) Library "des64.dll" alias for "b64_des;Ansi"
c#的函数
byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8)); byte[] rgbIV = Encoding.UTF8.GetBytes(encryptKey); byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString); DESCryptoServiceProvider dCSP = new DESCryptoServiceProvider(); MemoryStream mStream = new MemoryStream(); CryptoStream cStream = new Cry
CryptoStream cStream = new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write); cStream.Write(inputByteArray, 0, inputByteArray.Length); cStream.FlushFinalBlock(); return Convert.ToBase64String(mStream.ToArray()); |