How usernob/rust-rsa works
Rust RSA is an educational command-line tool for generating RSA keypairs and encrypting or decrypting files and Unix streams. The primary workflow starts at the CLI: key generation delegates to prime generation and RSA key construction, then saves public/private keys; encryption and decryption load the appropriate key, open file or standard-stream endpoints, and process fixed-size binary blocks. The graph separates CLI orchestration, key/prime mathematics, and key and stream I/O. Major stages are documented in the README; links are limited to relationships shown in the excerpts or README.
Main entry points: main.rs CLI commands · file.rs Stream endpoints · rsa.rs RSA operations · constant.rs RSA constants
Components 13
CLI orchestration
- CLI commands
src/main.rs
RSA mathematics
- Key generation
src/rsa.rs - Prime generation
src/prime_number.rs - RSA operations
src/rsa.rs - RSA constants
src/constant.rs
Key and stream I/O
- Key file handling
src/file.rs - Stream endpoints
src/file.rs
Other components
- CLI user
- Plaintext stream
- Binary ciphertext
- Keypair files
- stdin
- stdout
Connections 18
- CLI user → CLI commands: runs commands
README.md - CLI commands → Key generation: requests keys
src/main.rs - Key generation → Prime generation: generates primes
src/rsa.rs - Prime generation → RSA constants: checks exponent
src/prime_number.rs - Key generation → RSA constants: uses exponent
src/rsa.rs - CLI commands → Key file handling: saves keys
src/main.rs - Key file handling → Keypair files: writes keypair
src/file.rs - CLI commands → Key file handling: loads key
src/main.rs - CLI commands → Stream endpoints: opens streams
src/main.rs - CLI commands → RSA operations: processes data
src/main.rs - RSA operations → RSA constants: uses exponent
src/rsa.rs - Stream endpoints → stdin: reads default
src/file.rs - Stream endpoints → stdout: writes default
src/file.rs - Plaintext stream → Stream endpoints: input bytes
README.md - Stream endpoints → RSA operations: feeds blocks
src/main.rs - RSA operations → Binary ciphertext: writes blocks
README.md - Binary ciphertext → Stream endpoints: input blocks
README.md - RSA operations → Plaintext stream: writes bytes
README.md