code_junkie

PHP Encryption openssl_pkcs7_encrypt() Failing

Nov 14th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. $fp = fopen($unenc_path, "w");
  2. fwrite($fp, $msg);
  3. fclose($fp);
  4.  
  5. $easy_access_emails = 'person@##.com';
  6. $headers = "From: support@##.com <support@##.com>n" .
  7. "Reply-to: support@##.comn" .
  8. "Subject: " . $subject . "n";
  9.  
  10. $key = implode("", file("../newcert.pem"));
  11.  
  12. $ArrayMessageProperties = explode("n", $headers);
  13.  
  14. $unenc_path = '..\tmp\'. preg_replace('/[^0-9]/','', microtime()) . rand(0,1000) . "msg.txt";
  15. $enc_path = '..\tmp\'. preg_replace('/[^0-9]/','', microtime()) . rand(0,1000) . "enc.txt";
  16.  
  17. if (openssl_pkcs7_encrypt($unenc_path, $enc_path, $key, $ArrayMessageProperties))
  18. {
  19. $info = file_get_contents($enc_path);
  20.  
  21. foreach ($easy_access_emails as $email)
  22. {
  23. mail($email, $subject, $info, $headers);
  24. }
  25. } else {
  26. die("Failed Encryption");
  27. }
  28.  
  29. w3wp.exe:4172 C:windowssystem32tmp4277530010012336..msg.txt PATH NOT FOUND Options: Open Access: Read
Add Comment
Please, Sign In to add comment