I need to encrypt with hmac-SHA256 a string that contains ‘\n’ in it.
I’ve tested the output of the crypto.hmac(crypto.sha256) method against an online calculator and as long as the string DOES NOT include ‘\n’ they match up. But as soon as I add that “new line” code, the returned encrypted strings don’t match.
below is an example:
text to encode: \n
key to encode: key
CoronaSDK result:
2e2023d953f100d6d6a5ee33810c9e47057ef9ecd698c719377ec1fe43af038b
Online Calculator result:
8a796b8d7f9d0bd2e7620975116f523ab0aa48e1e6f8fb0e09c7f45a01736674
testing WITHOUT the \n text:
text to encode: test
key to encode: key
02afb56304902c656fcb737cdd03de6205bb6d401da2812efd9b2d36a08af159
02afb56304902c656fcb737cdd03de6205bb6d401da2812efd9b2d36a08af159
THEY MATCH!
Any Ideas? [import]uid: 64596 topic_id: 22457 reply_id: 322457[/import]