Aug 23

So i’m trying to port the sample code for a credit card processing gateway from PHP to ruby. You’d think that doing MD5 in any language would yield the same results.

Let me be clear. When it comes to cryptography and hashing: there is ZERO margin for error. If the hash doesn’t match, then you might as well call Georgia a color. Case in point. Do these match?

dd419504095a2f81a59aebd86ce2b75f

4b10c62d108c31227356b3953d19be28

Uh, no, they don’t. Let me give you a little example on hashing using MD5. The idea of a hash like MD5 is that if you give it an input, it can create a UNIQUE sequence of characters that can NEVER be repeated given the input.

Here is MD5 for “Hank”: ba02b1e3410f72ad50c76f9c144d6b34

and “hank”:

b6dfea72ba631c88abe4a1d17114bfcf

enjoy.