I am trying to find a reasonable solution to enforcing authentication between a client and a server via an API system. The API itself however isn't my problem, my problem is that where browsers typically support cookies and other means of letting the server know who it is an what its doing, the same isn't necessarily always the case with custom applications written in any possible languages.
I have had a look at some other questions, and the answers are useful for example: Authentication between client-side JavaScript application and Server Side HTTP API?
Unfortunately i had already thought of that and it doesn't implement the level of security that I'm after. What I need advice on is the approach to take when implementing (or maybe emulating) a kind of SSL that can be used on server to client scripts where the server and the client don't necessarily support SSL.
At the same time, this needs to be used to identify the client.
To summarize I need to implement a session keeping system and a data encryption system that will work with Apache and PHP, and a client written in any language running on any device.
Sorry if the question is a little long winded.