0

I am brand new to hashes, so I apologize in advance for the newbieness.

What I Want to Do

I have a large list of sha256 hashes that correspond to email addresses. I have no way of knowing the original email addresses. The sha256 hashes were generated from SQL server and appear to be in varbinary. An example is: 0x3EFE04CD91AE58D9AE6019A330DDE09928C1586AC0F998B379AAF46772AAE326.

What I need to do is generate SHA256 hashes of another list of email addresses which I do have and then compare the newly generated hashes with the original list to find the matches.

My problem

I do not have SQL server, and I have not been able to find a way to generate the varbinary type of hash. All of the solutions that I find using R, online hash generators, and mysql generate the hash using characters such as 5e524c1ccbb13fe78f4a370fa67b14b338e0034dd341f257a5ad33a992f5e5fb.

It is entirely possible that it's just my ignorance here, and I would appreciate any reading to help me learn more about this. Ideally, my solution would be done using R, and I already have the code prepared to do it. Of course, none of the generated hashes match given the above problem.

My questions is: How can I convert the varbinary sha256 hash to a character using either mysql, R, or JavaScript? I prefer R or mysql for this if possible.

I appreciate any insights in advance!

Community
  • 1
  • 1
sharly
  • 237
  • 2
  • 7
  • https://stackoverflow.com/questions/1873085/how-to-convert-from-varbinary-to-char-varchar-in-mysql – soft87 Oct 05 '17 at 21:19
  • In reading more about this issue, my original question as proposed is wrong. I now understand that the `0x` portion is just in binary indicator and can be safely removed to keep just the sha256 hash. So in my original post the `0x3EFE04CD91AE58D9AE6019A330DDE09928C1586AC0F998B379AAF46772AAE326 ` includes the binary indicator, `0x`. If I remove it, then I get the clean sha256 hash of `3EFE04CD91AE58D9AE6019A330DDE09928C1586AC0F998B379AAF46772AAE326 `. So, if I remove the `0x`, I should be able to do my comparison. I will confirm a final solution before accepting as the answer. – sharly Oct 09 '17 at 16:30

0 Answers0