Reputation: 13
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.
Upvotes: 1
Views: 416
Reputation: 36
You need to consider the cracking phase separately from the creation phase.
The creation phase runs very efficiently on GPUs as it is very straight forward. You need to generate a huge number of long chains made of alternating hash and reduction function and store the first and last element in a table. The ratio between hash calculation and table writes is large, thus table writes will not slow down the GPU.
Cracking requires a lot of table lookups. Indeed you are going to generate many chains of increasing length and you need to look up the end of each chain in the tables. Cracking will thus mostly be limited by bandwidth of memory or file access and the GPU will not give a large advantage against a CPU.
The exact performance will depend on the parameters of your table (number and length of chains). It strongly depends on whether you can fit the table in RAM or if it has to be stored on disk.
Note that you (or somebody else) only need to create the table once.
Upvotes: 1
Reputation: 76414
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.
Upvotes: 2