Tutorial :Best Encryption algorithm (PHP) to authenticate users from other sites



Question:

I have two sites.

The first site requires users to log in. An authentication token then will be passed to the second site when the users navigate from the first to the second. So the users can't just grab the url of the second sites and login to it.

What is the best encryption/ authentication algorithm that I can use for the this authentication purpose?


Solution:1

Typical PK scheme. On site1 encrypt auth info with site1's private key, and site2's public key. On site2 decrytp using site2's private key, and site1's public key.

Functions of interest:


Solution:2

Be sure to have a look at the OpenID protocol, it does what you want.


Solution:3

I'd use AES encryption.

Why a symmetric encryption? It's faster and less resource intensive. (CPU, bandwidth) You can just distribute the keys and then it's just as safe as the asymmetric encryption.

The advantage of asymmetric encryption exists only if the two clients don't know each other.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »