Problems with a hash value as blob in a database

Phew – I tried many things including new framework crypto methods and some of Christian’s classes, but I don’t get the source of the problem:

I try to save a hash value for the password of a user in a SQLite database.
I do so by reading a value from a textfield and creating a hash memoryblock from it:

dim pwstring as string = TextField2.text.DefineEncoding(encodings.utf8) dim newhash as MemoryBlock = Crypto.Hash (pwstring, Crypto.Algorithm.SHA512)

and then assign it to the recordset I just opened:

rs.Edit rs.Field(jobhashfield).Value = newhash rs.Update

This works nicely. For a returning user, I can read the value:

   dim comparehash as MemoryBlock = rs.field(jobhashfield).nativevalue

and simply compare both memoryblocks.

This all works great, except it only works as long as I stay on the same desktop platform. Once I compile for Linux and have it access the SQLite database created under OS X, it tells me the password is wrong. If I set a password under Linux, I cannot open it under a Mac. There must be something wrong with the encoding, but I don’t get what. Do you have any advice?

Just wild guessing: BigEndian / LittleEndian problem with the MemoryBlock?

Yay! Of course! Thanks a lot, Alex, that made my day!