{"action":"created","issue":{"url":"https://api.github.com/repos/jxtech/wechatpy/issues/428","repository_url":"https://api.github.com/repos/jxtech/wechatpy","labels_url":"https://api.github.com/repos/jxtech/wechatpy/issues/428/labels{/name}","comments_url":"https://api.github.com/repos/jxtech/wechatpy/issues/428/comments","events_url":"https://api.github.com/repos/jxtech/wechatpy/issues/428/events","html_url":"https://github.com/jxtech/wechatpy/pull/428","id":421399818,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYxNDU3NjQ3","number":428,"title":"feat (wxa) : decrypt WechatMiniprogram user data.","user":{"login":"SeverusWell","id":13058323,"node_id":"MDQ6VXNlcjEzMDU4MzIz","avatar_url":"https://avatars2.githubusercontent.com/u/13058323?v=4","gravatar_id":"","url":"https://api.github.com/users/SeverusWell","html_url":"https://github.com/SeverusWell","followers_url":"https://api.github.com/users/SeverusWell/followers","following_url":"https://api.github.com/users/SeverusWell/following{/other_user}","gists_url":"https://api.github.com/users/SeverusWell/gists{/gist_id}","starred_url":"https://api.github.com/users/SeverusWell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeverusWell/subscriptions","organizations_url":"https://api.github.com/users/SeverusWell/orgs","repos_url":"https://api.github.com/users/SeverusWell/repos","events_url":"https://api.github.com/users/SeverusWell/events{/privacy}","received_events_url":"https://api.github.com/users/SeverusWell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-03-15T08:12:36Z","updated_at":"2019-03-18T08:17:14Z","closed_at":"2019-03-16T08:51:35Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/jxtech/wechatpy/pulls/428","html_url":"https://github.com/jxtech/wechatpy/pull/428","diff_url":"https://github.com/jxtech/wechatpy/pull/428.diff","patch_url":"https://github.com/jxtech/wechatpy/pull/428.patch"},"body":"> WeChatWxaCrypto 微信小程序开放数据校验与解密\r\n\r\n详情请参考: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html\r\n\r\n\r\n\r\n参数:\r\n\r\n| 属性           | 类型   | 说明                 |\r\n| -------------- | ------ | -------------------- |\r\n| appid          | string | 小程序appID          |\r\n| session_key    | string | 对称解密秘钥         |\r\n| iv             | string | 对称解密算法初始向量 |\r\n| encrypted_data | string | 对称解密的目标密文   |\r\n\r\n返回:\r\n\r\n```\r\n解密后的微信开放数据\r\n```\r\n\r\n示例\r\n\r\n```\r\nfrom wechatpy.crypto import WeChatWxaCrypto\r\n \r\nappid = 'wx4f4bc4dec97d474b'\r\nsession_key = 'tiihtNczf5v6AKRyjwEUhQ=='\r\nencrypted_data = 'CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=='\r\niv = 'r7BXXKkLb8qrSNn05n0qiA=='\r\n\r\ncrypto = WeChatWxaCrypto(iv, session_key, appid)\r\ndecrypted = crypto.decrypt_message(encrypted_data)\r\n```"},"comment":{"url":"https://api.github.com/repos/jxtech/wechatpy/issues/comments/473811252","html_url":"https://github.com/jxtech/wechatpy/pull/428#issuecomment-473811252","issue_url":"https://api.github.com/repos/jxtech/wechatpy/issues/428","id":473811252,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MzgxMTI1Mg==","user":{"login":"SeverusWell","id":13058323,"node_id":"MDQ6VXNlcjEzMDU4MzIz","avatar_url":"https://avatars2.githubusercontent.com/u/13058323?v=4","gravatar_id":"","url":"https://api.github.com/users/SeverusWell","html_url":"https://github.com/SeverusWell","followers_url":"https://api.github.com/users/SeverusWell/followers","following_url":"https://api.github.com/users/SeverusWell/following{/other_user}","gists_url":"https://api.github.com/users/SeverusWell/gists{/gist_id}","starred_url":"https://api.github.com/users/SeverusWell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeverusWell/subscriptions","organizations_url":"https://api.github.com/users/SeverusWell/orgs","repos_url":"https://api.github.com/users/SeverusWell/repos","events_url":"https://api.github.com/users/SeverusWell/events{/privacy}","received_events_url":"https://api.github.com/users/SeverusWell/received_events","type":"User","site_admin":false},"created_at":"2019-03-18T08:17:14Z","updated_at":"2019-03-18T08:17:14Z","author_association":"CONTRIBUTOR","body":"@messense \r\nSure,ervery is fine.It's very concise.\r\n![image](https://user-images.githubusercontent.com/13058323/54516105-ef4a6e80-4998-11e9-9b8e-f494beed6d33.png)\r\n"}}
{"actor":{"display_login":"SeverusWell"}}