updated crypto definitions to use buffers / added setImmediate

Hi,
I have made a couple of changes to the crypto library, as this should be updated to use buffers as well as strings