Skip to main content

rainbowtables

Downloads Downloads/Month PyPI Version Last Commit Repository Size License MIT Discord Profile

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))
print("The full path of the file is", rt.get_full_path(file_extension=True))

If full_path is 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_extension is 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, compression=True) #display_progress shows the current word being iterated
#or
wordlists = ["wordlist1.txt", "wordlist2.txt"]
rt.insert_wordlists(wordlists, "sha256", wordlist_encoding="utf-8", display_progress=True, compression=True) #this function inserts multiple wordlists at once

When the insert function is called, it will use the current set file directory to insert into. Make sure to use set_directory() and set_filename() before insert is called, and in the same program.

Both wordlist_encoding and display_progress are set to their default values in the example. However, the default value for compression is False.

The insert function will iterate through each word inside of the wordlist, and store its hash in the rainbowtable.
The insert_wordlists function will do the same as the insert function, but also iterate through multiple wordlists to put into the rainbowtable. The efficieny of this function is going to be improved in a future update.

lookup = search(
    "97b7a2c97203792e932f1a2d26eb5b3f780ab9ec42e9f189186e6353d7564a2c", 
    "demo_table", #this could also rt.get_full_path(), with full_path set to True
    full_path=False, #full_path default value is False
    time_took=True, #time_took default value is True
    compression=True) #compression should only be True if the insert function compressed the table

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_path is 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_path is 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.

CHANGELOG

1.0.6

  • Created CHANGELOG.
  • Fixed subscript error for versions <3.9.

Metadata

Release files for rainbowtables 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rainbowtables 1.0.6
File Size Uploaded
rainbowtables-1.0.6.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rainbowtables 1.0.6
File Interpreter ABI Platform
rainbowtables-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / rainbowtables-1.0.6.tar.gz

Download URL rainbowtables-1.0.6.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
54391e0c6aea72d570f77abc359c376434716bcdf3f33ebdd8c584cce8af0eec
BLAKE2b-256 checksum
How to use checksums
2b7ca1af07fd42cf0151767dee2a8e9904845937d54808e67c1d0e9e2e9dcdb9
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / rainbowtables-1.0.6-py3-none-any.whl

Download URL rainbowtables-1.0.6-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02f20d2880a0a0c4543c9f9812eb970d360b11d372fa1a7bd378233400a2dda6
BLAKE2b-256 checksum
How to use checksums
302450fb4833fb7e7e95b458c1e2beb71bf6d8a140e2ed29eee7fecad5d3601c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page