I want to decrypt the WP username and ID that I am sending to it as a security check to the PHP I wrote that process’ SMS message sending.
Hm, I can’t say I’m very experienced with doing this. In the past I’ve used PHP mcrypt_encode and mcrypt_decode to do encryptions with a secret key. This way you can just keep your key recorded in your external file and in WordPress, and encrypt and decrypt by that key.
These are the PHP.net docs for that function:
http://php.net/manual/en/function.mcrypt-encrypt.php
When I used mcrypt in the past, I found that the cyphers were really confusing. Here’s a tip:
In 2001, the US Government made AES (called Rijndael in PHP) the standard for encryption. If you’re encrypting, the easiest/safest way to do it would be using MCRYPT_RIJNDAEL_128, MCRYPT_RIJNDAEL_192, or MCRYPT_RIJNDAEL_256 as the cypher, and ecb as the mode.
See: http://php.net/manual/en/mcrypt.ciphers.php
See Also: http://stackoverflow.com/questions/2809855/which-php-mcrypt-cipher-is-safest
I know that’s confusing, but I suppose it’s supposed to be.