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 (R,P,H). 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.

  • What are you trying to achieve? Please edit your question to clarify. – SilverlightFox Oct 1 '14 at 9:10
  • Kosho - have you read up on the difference between rainbow tables and hash tables? This is a basic prerequisite. If you read any rainbow tables documentation you will see what they are for. As SilverlightFox asked - can you edit your question to explain what you want to achieve. For some applications a hash table is what you want, but for others a rainbow table will be so much more useful. – Rory Alsop Oct 1 '14 at 11:34
  • rainbow tables are good for space/computing trade off as i saw. but i cant find any advantages when generating the next plaintext from hash,its seems wierd . moreover, i cant find reason not to generate range of plaintext - lets say "000000" -> "999999" ( 6 digits all numbers) , and save the first plaintext , save the first plaintext & the last hash and use this like "rainbow table" – user56582 Oct 11 '14 at 6:14