I am trying to think of the best way to encrypt and decrypt a message between two servers. I have found a lot of examples where people simply use a secret and PHP's mcrypt...
https://stackoverflow.com/questions/16600708/php-string-encrypt-and-decrypt
But I am thinking of using certificates instead.
https://stackoverflow.com/questions/7480681/crypt-decrypt-string-php
Am I wrong in my assumtion that it would be more safe? Or is it pretty much the same deal? With certificates you need to get to the private key on the receiving end... with the string version you need some access to the code on one of the two ends to get a hold of it.
And whould the crypto be more safe using certificates? Like creating a 2048-bit RSA.
Thanks.