#######################################################################################################################* *-------------------------------------------------------Encryption--------------------------------------------------------* *#########################################################################################################################*/
| 1084 | *-------------------------------------------------------Encryption--------------------------------------------------------* |
| 1085 | *#########################################################################################################################*/ |
| 1086 | cc_result Platform_Encrypt(const void* data, int len, cc_string* dst) { |
| 1087 | DATA_BLOB input, output; |
| 1088 | int i; |
| 1089 | input.cbData = len; input.pbData = (BYTE*)data; |
| 1090 | |
| 1091 | Crypt32_LoadDynamicFuncs(); |
| 1092 | if (!_CryptProtectData) return ERR_NOT_SUPPORTED; |
| 1093 | if (!_CryptProtectData(&input, NULL, NULL, NULL, NULL, 0, &output)) return GetLastError(); |
| 1094 | |
| 1095 | for (i = 0; i < output.cbData; i++) |
| 1096 | { |
| 1097 | String_Append(dst, output.pbData[i]); |
| 1098 | } |
| 1099 | LocalFree(output.pbData); |
| 1100 | return 0; |
| 1101 | } |
| 1102 | |
| 1103 | cc_result Platform_Decrypt(const void* data, int len, cc_string* dst) { |
| 1104 | DATA_BLOB input, output; |
nothing calls this directly
no test coverage detected