msgid:5931128898825548248_1631091601006_external
encrypt_random_key:6VXk9yp15lIfWeYywdSjJWzDc+BtjB4Xo1kX+FRYFwKYND0KfAXPMY+II1UYXKhBzzfA3e8YWHCQcryuu0lix6uNK7PfthUFHHscTQLrqj2+iWrlsAU4ECrHdbIEdxh7Ep6eAelUmRrhA0SnW0CJUeyAc2S19WzG5RBinSsmyoUB1GOUBz62uYVznFpB9xrRVj+GEVJViY2m41H+v0OUoiIZ5twikn4tiNeFxRTIjcRUY6waCwbvIp+Tq6GqXdaP2fcfRe8m+VrUKR81TEHVEjvVjZlBmbl1BnR3QUPlKhKvM+os2UGC9WzLtfFBThj22l1unHmp9HvXpdAc3wAMA==
encrypt_chat_msg:h6OxBtzpQlmCmRqnERT2dlI2XyK70oOrnsJEHY0ztUzB5ty9+UuKzPfV7qAe5V54FhBw/upC5SUpSgSN81oyjQBUr3t6E85hJLkLrAFd0wKnWeRIV9s0/NnbB/PdmDhabrWueMAPtmFQ9bhPPspMRVoTqTOr03Q4XcV92esCHcHCzG3HOLru33YXCwzLOFPtXPcHh47LYSejkc4jCxVDkC/BvjFwNbsPE91UDp+t+KrI1+LcMM3IwojDDXURJfuBdDaFJX2YFjyRsk2/thOQDd1kEtg5l9H/E4y6tjteT/n7Qe8YZlgYdJ013PVuAq5CrgrkC3MOcae6HDM3NdNC5b4BXueXLm3LaK2f+z7+TM=IPhAQo5T
Corpid:wx96b2b87fa5cad6b3
解密encrypt_random_key返回:QQFJrsYlpk/vw4M5x6rxcryqzV62lT0sA/kLzsC7g3KbNeOiupQxY623FmVq3SOSV5hgjxQeIOUI5EHIXAG5Iw==
调用方法:DecryptData(sdk, encrypt_key, encrypt_msg, msg);
返回:10008
你好,试了下是正常解密的,chatdata :{"msgid":"5931128898825548248_1631091601006_external","action":"send","from":"admin","tolist":["wm9DKPDwAAEMvcDQ7KiTM_OoOTRWQD3g"],"roomid":"","msgtime":1631091600862,"msgtype":"text","text":{"content":"0"}} ret :0,需要使用我们的demo把解密encrypt_random_key和encrypt_chat_msg传入即可
我用的是 sdk_win_v1.1.zip\financeWinSdk\C_sdk\FinanceSdkDemo\WeWorkFinanceSdk.dll
程序环境是C#,托管调非托管的函数如下
/**
* @param [in] encrypt_key, getchatdata返回的encrypt_key
* @param [in] encrypt_msg, getchatdata返回的content
* @param [out] msg, 解密的消息明文
* @return 返回是否调用成功
* 0 - 成功
* !=0 - 失败
* @brief 解析密文
*/
[DllImport("WeWorkFinanceSdk.dll")]
public static extern int DecryptData(long sdk, String encrypt_key, String encrypt_msg, long msg);
//主调程序片段
string encrypt_chat_msg = @"h6OxBtzpQlmCmRqnERT2dlI2XyK70oOrnsJEHY0ztUzB5ty9+UuKzPfV7qAe5V54FhBw/upC5SUpSgSN81oyjQBUr3t6E85hJLkLrAFd0wKnWeRIV9s0/NnbB/PdmDhabrWueMAPtmFQ9bhPPspMRVoTqTOr03Q4XcV92esCHcHCzG3HOLru33YXCwzLOFPtXPcHh47LYSejkc4jCxVDkC/BvjFwNbsPE91UDp+t+KrI1+LcMM3IwojDDXURJfuBdDaFJX2YFjyRsk2/thOQDd1kEtg5l9H/E4y6tjteT/n7Qe8YZlgYdJ013PVuAq5CrgrkC3MOcae6HDM3NdNC5b4BXueXLm3LaK2f+z7+TM=IPhAQo5T";
string encrypt_key = @"QQFJrsYlpk/vw4M5x6rxcryqzV62lT0sA/kLzsC7g3KbNeOiupQxY623FmVq3SOSV5hgjxQeIOUI5EHIXAG5Iw==";
//上面2个参数值都是这个问题里面的
long sdk = WeWorkFinanceSdk_t.NewSdk();
long slice = WeWorkFinanceSdk_t.NewSlice();
int ret = WeWorkFinanceSdk_t.DecryptData(sdk, encrypt_key, encrypt_chat_msg, slice);
if (ret != 0)
{
//执行到这个分支来了
MessageBox.Show("解密出错=" + ret);
return;
}