我需要用wincrypt解密一些数据文件,网上的例子很少。我发现的最可靠的例子是here。但是,这是使用各种我似乎无法找到相关信息的类型(CBase64Utils、CString 等)。
我正在阅读最终的解决方案,试图理解这个过程,并得出了这个结论:
// 5. Determine the LENGTH of the BUFFER to hold the corresponding cyphertext.
CBase64Utils bu;
int ipszSourceLen = strlen(pszSource);
char *pszSource2 = bu.Decode(pszSource, &ipszSourceLen);
DWORD dwSourceLen = strlen(pszSource2); // Get the length of the input string.
DWORD dwDataLen = dwSourceLen;
BYTE* pTarget = NULL;
DWORD dwCryptDataLen = dwDataLen;
CryptEncrypt(hKey, 0, TRUE, 0, NULL, &dwCryptDataLen, dwDataLen);
这对我来说是纯中文。任何人都可以理解它并希望清除一些浑水吗?谢谢