Skip to main content

haccks animated logo

Hacker Animation Cool Console Kryptographic Sequencer (haccks)

Description

a digital rain code password decrypting effect library for Python, useful to visually represent character by-character secrets retrieval attacks. For example a binary search in a blind database injection.

inspired by the "cryptographic sequencer" from the Batman Arkham video games series and the phone number tracking effect from the Matrix movie intro

Usage

basic example
from haccks import Haccks

password = "T0psyKr33t!"

h = Haccks(len(password))

# guess 1 character by second
for i, c in enumerate(password):
    h.setCharacter(i, c)
    time.sleep(1)

basic example

change colors and framerate
from haccks import Haccks

h = Haccks(24, refreshDelay=1,
                    primaryColor="purple", secondaryColor="fuchsia")
h.setCharacter(0, 'A')
h.setCharacter(23, 'Z')

custom colors example

set a custom alphabet
from haccks import Haccks

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&()*+<>?'
e = Haccks(40, alphabet, refreshDelay=0.01,
                    primaryColor="yellow2", secondaryColor="aqua")


# cool animation: guess one random potential character by millisecond 
lal = [random.sample(list(alphabet), len(alphabet)) for _ in range(40)]
while True:
    r = random.randint(0, len(lal)-1)
    if len(lal[r]) > 1:
        e.removeCharsFromAlphabet(r, lal[r].pop())
        time.sleep(0.001)

custom colors example

call a custom method at the animation end
from haccks import Haccks

from blessed import Terminal

def myCustomEnding(term: Terminal):
    paddH = term.height // 2 - 2

    print(term.clear)
    print(term.move_yx(paddH, 0) + term.chocolate1 +
          term.center("It’s now safe to turn off"))
    print(term.move_yx(paddH+1, 0) + term.chocolate1 +
          term.center("your computer"))
    time.sleep(5)

h = Haccks(12, customEndingMethod=myCustomEnding)
...

custom colors example

Documentation

Please tell me if it's not clear
(it makes sense in my mind, but that's because i'm a genius :P)

# constructor of effect. immediatly displays fullscreen on terminal.
# ex: you know you have a 7 chars long secret to guess that can only be hexadecimal chars:
#   Haccks(7, '0123456789abcdef')

h = Haccks(
    numChars: int,               # number of "cracking" characters to display
    alphabet: str = "",          # possible chars shown.
    refreshDelay: float = 0.01,  # sleep time between each refresh of the effect

    # check blessed.readthedocs.io/en/latest/colors.html for available colors
    primaryColor: str = "green",    # color of the found characters 
    secondaryColor: str = "normal", # color of all other characters

    customEndingMethod: Callable[[blessed.Terminal], None] = None # custom method called at end
)

# set a character as "decoded", won't change and will appear in PrimaryColor
# ex: you found with a certitude that the second char of your secret is 'c': 
#     h.setCharacter(1, 'c')

h.setCharacter(
    position: int   # index of the character
    character: str: # char to set
)

# remove possible characters from the alphabet of an index
# ex: you know that the third char of your secret cannot b 'Z': 
#     h.removeCharsFromAlphabet(2, 'Z')

h.removeCharsFromAlphabet(
    position: int,  # index of the character
    characters: str # chars to exclude from alphabet
)

features and todos

Done
  • some errors and automatic managements

    • removing alphabet characters will validate a character if there is only 1 char left.
    • if all characters are validated the ending is displayed
  • blazingly fast (printing characters one by one? nobody would try that...)

  • multiplatform (thanks to the blessed library)

  • customisable (colors, custom ending)

  • stoppable (type q to quit)

  • window resize aware

TODO
  • more customization?
    • non-fullscreen mode?
    • multiple secrets guesses?
  • use multiprocessing instead of threading ? (very small performance gain)
  • more? (pull requests are open)

Metadata

Release files for haccks 1.1

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

Source distribution (sdist)

Source distribution for haccks 1.1
File Size Uploaded
haccks-1.1.tar.gz 6.7 kB Details

Built distribution (wheel)

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

Total release size: 14.5 kB

Release files / haccks-1.1.tar.gz

Download URL haccks-1.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
296ffb267b7ef3143f7b10cb05e0b0d48b5d73081a63bd6833838ed62439a32e
BLAKE2b-256 checksum
How to use checksums
68f99f4e8f3f9d62d51b3c43149928bbb15ed44f0a5447cf3ed5c9114ec7c6a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / haccks-1.1-py3-none-any.whl

Download URL haccks-1.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed1a17b68a3bd77e0c52d67b003ef02c9f0dd4756522d133adf504c36d567452
BLAKE2b-256 checksum
How to use checksums
97fb65e88dfd70399b865cc06c53981fa3ee2e79908c2b9f855787d8471890e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.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