Email Encryption, yay!
So today I was able to successfully send an encrypted email from a PHP application of mine. This isn’t too hard to do with basic plain emails and using say GPG with the PHP GPG extension. I played with this first but came to choose S/MIME based encryption method instead since it’s actually supported by nearly every email client without plugins/addons. This seems way more ideal, you can even get a free certificate from thawte for email use. I was able to find out how to do this in PHP via the openssl extension’s openssl_pkcs7_encrypt function. So today I finished up the encryption support in the web application I was working on by getting html emails to encrypt & send and then show up right on the other end. Was pretty excited to get that working, was just a matter of putting the mime/html related headers into the message data to be encrypted.
Small annoying part is the openssl_pkcs7_encrypt function takes file paths for arguments, not variables with data. So you have to save stuff to say /tmp then delete. Kinda stinks.
Technorati Tags: development, php, encryption
Tags: development, encryption, PHP