I currently have an antiquated CMS system that I'm trying to add a realtime chat feature to. The CMS runs using IIS, MSSQL and PHP.
The chat feature will run from a separate linux box running Nodejs and Socket.io
I've managed to get the CMS to successfully open a connection to the Node server and now I need some way of authenticating the user.
My only idea at the moment is to put together an array of user data (id, name, email address), create a hash of this data and then send both the data and the hash to Node. The Node server would then attempt to hash the data and validate it against the hash sent by the CMS. (obviously both the CMS and Node would have a predetermined private salt for the hashing)
Is there a better way of achieving this?!
A good rule of thumb is: Don't roll your own crypto unless you're a cryptographer, and even then think twice.
My suggestion would be this: