How ot-kartoshka/rabbitcipher works
RabbitCipher is a C++ CLI for encrypting and decrypting files with the Rabbit stream cipher. The main workflow parses options, resolves paths, and delegates file processing to RabbitManager, which obtains key material, selects or generates an IV, handles the encrypted-file header, and streams bytes through the cipher in 4 MB chunks. Key generation and persistence are separate from the cipher core. The README documents interactive and quiet modes, IV conflict handling, and headerless operation; implementation relationships below are cited only where shown in the supplied excerpts.
Main entry points: RabbitManager.cpp Processing Coordinator · main.cpp CLI Arguments and Paths · KeyManager.cpp Key and IV Management · Rabbit.cpp Rabbit Keystream
Components 11
CLI
- CLI Arguments and Paths
main.cpp - Error Messages
src/Errors.cpp
File Processing
- Processing Coordinator
src/RabbitManager.cpp - Buffered Stream XOR
src/RabbitManager.cpp - IV Header Handling
src/RabbitManager.cpp
Key and IV
- Key and IV Management
src/KeyManager.cpp
Cipher Core
- Rabbit Keystream
src/Rabbit.cpp
Other components
- User
- Input File
- Output File
- Key File
Connections 11
- User → CLI Arguments and Paths: provides options
README.md - CLI Arguments and Paths → Processing Coordinator: calls processing
main.cpp - CLI Arguments and Paths → Error Messages: formats errors
main.cpp - Processing Coordinator → Key and IV Management: loads or generates keys
src/RabbitManager.cpp - Key and IV Management → Key File: reads and writes
src/KeyManager.cpp - Processing Coordinator → Input File: reads file
src/RabbitManager.cpp - Processing Coordinator → IV Header Handling: handles IV metadata
src/RabbitManager.cpp - Processing Coordinator → Output File: writes file
src/RabbitManager.cpp - Processing Coordinator → Buffered Stream XOR: processes file chunks
src/RabbitManager.cpp - Buffered Stream XOR → Rabbit Keystream: XORs with keystream
src/RabbitManager.cpp - Processing Coordinator → Rabbit Keystream: initializes cipher
src/RabbitManager.cpp