I've read about rainbow tables (which I've confused with hash tables at first).
I understand that it uses a reduce function
R(x) and by saving start value
P(plaintext) and ending hashed value
H I can 'save' space by just saving
But I don't understand why I can't do that with hash tables: create "GetNext(x)" function
GN(x) and save start and end plaintext values
(P1, P2) and by that 'save' space, whereas it's clear that an attacker chooses to compute all hashes before or not.
For example a reduce function that returns the first 5 chars of md5. How I can handle with plaintext that contains special chars? Besides that I'll have collisions like:
Those hashes will get me the next plaintext after the reduce function, even if I'll add any random to it I'll always be limited to the input of the hash and it's length.
Last thing: if I have some rainbow tables, how can I ensure that I don't have duplicate plaintexts (collisions), as I see I can't without sorting and then all the idea of space is gone. Why don't just generate start and end plaintext values and store them if you want save space? I don't understand the logic behind trying to create plaintext from hash.