I recently had to implement a hashing algorithm that will be used as a key in seperate repositories. It wasn't too hard to pick SHA1 out of the many different types.
When implementing any encryption, it's important to make sure the algorithm works properly.
Hashing algorithms return gobbledegook. So to test a working algorithm, I encrypted "abc" in 2 different libraries (say, perl's Digest::SHA1 and a javascript library). Then I check that the resultant digest is identical.
I quickly found a problem where Perl returned a binary digest by default, when the default digest is a Hex.
So now I can implement my encryption code knowing the hash can be shared amongst different systems ('nix, .Net, javascript)
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment