A python library allowing the user to create a rainbowtable.
Project description
rainbowtables
Rainbowtables is a library where the user can create their own rainbowtable. This means that they can insert values from a wordlist into the table and then do a lookup for a word based on its hash. It essentially finds a plaintext match for a hash inside of the table. The rainbowtable has a worst case lookup time of O(log n), where 'n' is the size of the table, and a best case lookup time of O(1).
installation
using pip
pip install rainbowtables
using setup.py to install
git clone https://github.com/justbennnn/rainbowtables.git
cd rainbowtables
python setup.py install
usage
The following examples show the usage of every function in rainbowtables.
import rainbowtables as rt
rt.set_directory("/rainbow_table", full_path=False)
rt.set_filename("demo_table")
rt.create_directory()
rt.create_file()
print("The set directory has been created at", rt.get_directory())
print("The set file has been created at", rt.get_filename(file_extension=True))
If
full_pathis set to false, then the directory given will be created in relation to the program directory. If it is set to false, also remember the forward slash at the start of the directory name!
When
file_extensionis set to true, then the program will return .json at the end of the filename.
print(rt.supported_algorithms) #show the current supported algorithms
rt.insert("wordlist.txt", "sha256", wordlist_encoding="utf-8", display_progress=True)
#display_progress shows the current word being iterated
When the insert function is called, it will use the current set file directory to insert into. Make sure to use
set_directory()andset_filename()before insert is called, and in the same program.
Both
wordlist_encodinganddisplay_progressare set to their default values in the example.
The insert function will iterate through each word inside of the wordlist, and store its hash in the rainbowtable.
lookup = search(
"97b7a2c97203792e932f1a2d26eb5b3f780ab9ec42e9f189186e6353d7564a2c",
"demo_table",
full_path=False, #full_path default value is False
time_took=True) #time_took default value is True
if lookup != False:
print("The decrypted hash is", lookup[0] + ".") #output - The decrypted hash is https://www.youtube.com/watch?v=iik25wqIuFo.
print("It was found in", lookup[1], "seconds.") #output - It was found in 0.5 seconds.
If
full_pathis set to false, and the rainbowtable is in the current directory, set the path as shown above in the example.
Otherwise, if it is in a directory and
full_pathis set to false, enter the directory as normal, but remember the forward slash at the start.
The search function will return 1 of 3 results.
- The matching plaintext.
- A tuple containing the matching plaintext and the time taken to find it.
- False, meaning the lookup failed.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rainbowtables-1.0.0.tar.gz.
File metadata
- Download URL: rainbowtables-1.0.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59856cabee2cf16c746cc87d61442eb2923a1f77e1cb7e38ad82139a5255cd4c
|
|
| MD5 |
1663fb6b06ec15bc2adc0fb1dd06e24d
|
|
| BLAKE2b-256 |
06567619f89581f8a335a6012a3243420b9b70f7aec5e0f90d2b8b94c1d63930
|
File details
Details for the file rainbowtables-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rainbowtables-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
107dcc19afff987142e1639f3b55cf1b97df7836e1131fd50b8296cb13685c4f
|
|
| MD5 |
95f9889c80a41f1560be72ad1bb15e2f
|
|
| BLAKE2b-256 |
4786e8a0d139c9b65bc2f38248936269506efd876b211af5fb2d0063f4f100c5
|