aSSL ( Ajax Secure Service Layer ) is a libraries implements the technology similar to the SSL distributed under MIT license.
Working of aSSL
The Browser sends a request to the server to start the process.
Then the server returns some mules of RSA module and the public components.
Then the browser generates the 128 bit key for random exchange and encrypts the key using server key and forwarded it to the server.
The server gets the encrypted 128-bit key and decrypts it with its private key. If the result is ok the server passes the session duration time to the client.
Then the browser gets the session duration time from the server and sets the timeout to alive the connection.
All the exchange is done via aSSL and the key is encrypted and decrypted via AES algorithm.
Recommend the tutorial