hashgpucpurainbowtable

Does rainbow table run with GPU or CPU?


I know about rainbow tables but this question was asked to me during an interview and I couldn't answer . So my question is as it's said in the title I want to know if rainbow tables use GPU or CPU. And the reason for that. Thank you in advance!

I did some research about this but some resources said that rainbow tables use GPU some said both CPU and some said both. So I need a clear answer.


Solution

  • The answer is both and neither. The reason for this is that we are speaking about rainbow tables, that is, a data-structure with a specific content and, by the term "running", we extend this topic with an algorithm that either generates a rainbow table or searching for one and, on the other hand, we speak about hardware, that is, GPU vs. CPU.

    Let's first understand what a rainbow table is.

    To put it plainly, a rainbow table is a table which maps all possible keys with their values (think of hashes). See more here: https://www.techtarget.com/whatis/definition/rainbow-table

    It is not running per se, just like a file is not running by default. But there are things you could do regarding rainbow tables.

    First of all, you can generate them, that is, you can loop all possible values, run the hashing algorithm you want to map for these inputs and store the results somewhere.

    Second, you can search a key by the value, usually the hash.

    So, as we can see, there are already two main operations regarding rainbow tables and one can imagine further operations, such as indexing these tables so values can be quickly found, etc.

    Now, CPU and/or GPU are mediums where algorithms can be executed. You are speaking about hacking passwords, so, technically speaking both CPU and GPU can be used for this task. Yet, you may intend to quicken the process of a slow algorithm by running it on faster hardware, this is why a hacker may choose to run the generation and indexing of a rainbow table using GPU rather than CPU. However, CPU is also perfectly capable for this task. As about searching, that's a more lightweight operation than generating the full mapping, as you are only looking at the equality of values, possibly using an index as well rather than running the hashing algorithm for all possible values.