HashForge is a small terminal-based hash generator written in Python. It allows the user to enter any text and generate a digest using common hashing algorithms such as MD5, SHA1, SHA256, and SHA512.
The project is designed to be simple, readable, and easy to extend. It also has a cyber-themed ASCII header and a custom watermark to give the tool a distinctive look.
- MD5 generation
- SHA1 generation
- SHA256 generation
- SHA512 generation
- interactive terminal menu
- validation for invalid options
- retry flow for repeated use
- professional structure with small helper functions
- The script starts in the main block:
if __name__ == "__main__": generate_hash() generate_hash()prints the ASCII banner and watermark.- The user is prompted to choose a hash algorithm.
- The script validates the input and only accepts values from 1 to 4.
- The user enters the text to hash.
- The selected algorithm is applied with Python's
hashlibmodule. - The digest is printed in the terminal.
- The program asks whether the user wants to generate another hash.
- MD5
- SHA1
- SHA256
- SHA512
python gerador_de_hashes.pyThen choose one of these options:
1) MD5
2) SHA1
3) SHA256
4) SHA512
Example output:
Hash SHA256 for the text: "teste"
Result / Resultado: 46070d4bf934fb0d4b06d9e2c46e346944e322444900a435d7d9a95e6d7435f5
gerador_de_hashes.py— main scriptREADME.md— project documentation
This tool is intended for educational and development use. Hashing is a one-way process, so the generated digests should not be treated as reversible encryption.
Este projeto e um gerador de hash em terminal, escrito em Python. Ele recebe um texto digitado pelo usuario e gera o digest com algoritmos populares como MD5, SHA1, SHA256 e SHA512. A estrutura foi organizada em funcoes pequenas para facilitar a leitura, validaao e manutencao do codigo.
The main logic is concentrated in a few functions:
print_header()— prints the banner and watermarkget_hash_algorithms()— maps the numeric choice to a hash algorithmread_hash_type()— validates the user's choiceask_retry()— asks if the user wants to continuegenerate_hash()— orchestrates everything and prints the result
This approach keeps the code clean and makes it easier to expand with new algorithms or UI improvements later.