There is an example on this site, in the Algorithm section of the code libary.
Just out of interest, what are you trying to do ?
If you want to transfer information securly then this is not the way to do it, as the data is transmited from a browser is not encrypted, and will only be encyypted on the server.
If you are just trying to store encrypted data, then this is fine.
Anand