Hello to everyone,
I have a problem with Cryptography.md5 that I do not understand.
When I use this function, the returning result (16 byte string) is out of specification. How do I get the standard end result?
For example:
Print(Cryptography.md5("a")) -----> �u�����1�iw&a
or
dataSaver.saveValue("|D|somevalue", Cryptography.md5("a")) -----> {"data":{"|D|somevalue":"\fÁu¹Àñ¶¨1Ùâiw&a"}}
The actual result should be 0cc175b9c0f1b6a831c399e269772661
How can I get this result?
Where am I making mistakes? Can you help with the code sample?
Note:
I am also having the same problem between Gideros Cryptography.aesEncrypt and .NET System.Security.Cryptography. The key and IV are the same as the result of AES128 which is not the same.
Comments
Cryptography.md5() returns the 16 bytes hash in binary format, that is a string of 16 bytes, while you expect it to be hex-string encoded (32 characters).
Try this:
Likes: turker2000, antix
The result produced with .NET ----> z6rzKFeAyyNZZOQMRCHvnQ==
Likes: SinisterSoft
It takes the format pattern "%02x" (which format a byte as a two hex characters string), repeats it 16 times, feeds it to string.format() along with actual bytes to print from the md5 result.
the string is represented in lua as table ?
Likes: pie, antix