Simon Slavin <slav...@bigfraud.org> writes:
>> Please don't suggest other ways of achieving this. There are plenty and
>> I am able to use them. My question is about the pros and cons of adding
>> a one-way hash function to SQLite (maybe calling it crypt() was
>> misleading for some).
>
> That's what got me. Not only is crypt() the convention for an
> encrypting function, it's the convention for a particular encrypting
> function.

I see, sorry. I guess I fell into the GNU trap again (glibc crypt does
MD5 and SHA-x as well).


>> Also, I would appreciate if you would not start a discussion about the
>> possibility of collisions or the fact that same strings in different
>> tables or columns would map to the same hash and thus weaken the
>> scrambling (in case you are tempted to). Everyone who uses a hash
>> function can be expected to take those things into account (that's why
>> my example contained different salt strings for different columns).
>
> hash(x) does not sort the same way that x sorts, so any operation that
> depends on the order of the returned rows will not work the same way.
> Similarly, anything involving '>' or '<' won't give the same answers.
> You will not be able to do maths on numbers or string operations on
> strings.
>
> Even if your data is made up of discrete strings, and you only ever
> care whether two strings are identical, then you need to worry how
> lossy your hashing function is. There's a chance that it will turn two
> different strings in your source database into the same string in your
> hashed database. This will, of course, mean that not even '=' would
> work the same way.

Hmm, yes, these are good points. In my case they don't apply, but it
means that my idea is certainly not as generally applicable as I first
thought.


That said, I still think it would be nice to have a build-in hash
function in SQLite. Are Mark and I really the only two people who think
that would be useful? Or is there some legal problem to e.g. incorporate
the MD5 patch from mobigroup? (thanks for the link Alexey!).


Best,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to