crypto_lab
A Python Streamlit-based web application for experimenting with cryptographic algorithms and protocols using PyCryptodome.
Features
- Interactive web UI for cryptographic demos, including:
- SHA-256 hashing
- Random number generation
- HMAC (SHA-256)
- Key derivation functions (PBKDF2, scrypt, HKDF)
- AES encryption (CBC mode)
- RSA encryption and key transport
- ECC key generation
- Digital signatures (RSA)
- Shamir's Secret Sharing
Getting Started
Running the Web Application
- Launch the Streamlit web app using the main entry point:
python -m crypto_lab.run_web_app [--server-address ADDRESS] [--server-port PORT]
--server-address
: Address to bind the Streamlit server (default: system FQDN)--server-port
: Port to run the Streamlit server on (default: 8503)
source manual
WebApp()
Streamlit-based cryptographic algorithms and protocols playground.
aes_section()
AES encryption (CBC mode) demo.
ecc_section()
ECC key generation demo.
hmac_section()
HMAC (SHA-256) demo.
kdf_section()
Key derivation functions demo.
random_bytes_section()
Random bytes generation demo.
rsa_section()
RSA encryption demo.
rsa_transport_section()
RSA key transport demo.
run()
Run all Streamlit UI sections.
sha256_hash_section()
SHA-256 hashing demo.
shamir_section()
Shamir's Secret Sharing demo.
signature_section()
Digital signature (RSA) demo.
WebAppLauncher
Command-line interface and process launcher for the crypto_lab Streamlit web application.
Methods:
Name | Description |
---|---|
launch |
Optional[str], port: int) -> bool: Launches the Streamlit web application at the specified address and port. |
parse_args |
Parses command-line arguments for server address and port. |
launch(address=None, port=8503)
staticmethod
Launch the crypto_lab Streamlit web application.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
address
|
Optional[str]
|
Address to bind the server. If None, uses system FQDN. |
None
|
port
|
int
|
Port to run the server on. Defaults to 8503. |
8503
|
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the application started successfully, False otherwise. |
parse_args()
staticmethod
Parse command-line arguments for server address and port.
Returns:
Type | Description |
---|---|
Namespace
|
argparse.Namespace: Parsed arguments with 'server_address' and 'server_port' attributes. |
main()
Main entry point for launching the crypto_lab Streamlit web application. Parses command-line arguments and starts the web application.