updated crypto definitions to use buffers

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