demo.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. include_once "wxBizDataCrypt.php";
  3. $appid = 'wx4f4bc4dec97d474b';
  4. $sessionKey = 'tiihtNczf5v6AKRyjwEUhQ==';
  5. $encryptedData="CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZM
  6. QmRzooG2xrDcvSnxIMXFufNstNGTyaGS
  7. 9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+
  8. 3hVbJSRgv+4lGOETKUQz6OYStslQ142d
  9. NCuabNPGBzlooOmB231qMM85d2/fV6Ch
  10. evvXvQP8Hkue1poOFtnEtpyxVLW1zAo6
  11. /1Xx1COxFvrc2d7UL/lmHInNlxuacJXw
  12. u0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn
  13. /Hz7saL8xz+W//FRAUid1OksQaQx4CMs
  14. 8LOddcQhULW4ucetDf96JcR3g0gfRK4P
  15. C7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB
  16. 6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns
  17. /8wR2SiRS7MNACwTyrGvt9ts8p12PKFd
  18. lqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYV
  19. oKlaRv85IfVunYzO0IKXsyl7JCUjCpoG
  20. 20f0a04COwfneQAGGwd5oa+T8yO5hzuy
  21. Db/XcxxmK01EpqOyuxINew==";
  22. $iv = 'r7BXXKkLb8qrSNn05n0qiA==';
  23. $pc = new WXBizDataCrypt($appid, $sessionKey);
  24. $errCode = $pc->decryptData($encryptedData, $iv, $data );
  25. if ($errCode == 0) {
  26. print($data . "\n");
  27. } else {
  28. print($errCode . "\n");
  29. }