How smsmaydi/mode-of-operation works
This is a ReactFlow educational visualizer for ECB, CBC, and CTR block-cipher modes, with XOR/AES routing, image encryption and decryption, and encrypted-file output. Users enter plaintext, keys, and mode parameters, then build or use a preset data-flow graph; the app evaluates the graph or dispatches image work to cipher handlers, which update graph-node results. The graph preserves the documented AES-step visualization and mode presets. Relationships are limited to README statements and source references or excerpts; unsampled wiring is omitted.
Main entry points: App.js Graph app · aesHandler.js AES handler · index.js Cipher dispatch · xorHandler.js XOR handler
Components 23
Graph interaction
- Graph app
src/App.js - Graph inputs
src/components/layout/GraphInputsPanel.jsx - Node palette
src/components/palette/NodePalette.jsx - Mode selection
src/components/layout/ModeMenu.jsx - Mode presets
src/utils/presets.js - Plaintext input
src/components/nodes/PlaintextNode.jsx - Cipher node
src/components/nodes/BlockCipherNode.jsx - Ciphertext output
src/components/nodes/CiphertextNode.jsx
Graph evaluation
- Graph evaluation
src/utils/computeGraph.js - Dynamic blocks
src/utils/dynamicBlockGraph.js - ECB trace
src/utils/ecbTrace.js - Connection checks
src/utils/validators.js
Cipher operations
- Cipher dispatch
src/utils/cipherHandlers/index.js - XOR handler
src/utils/cipherHandlers/xorHandler.js - AES handler
src/utils/cipherHandlers/aesHandler.js - Image conversion
src/components/crypto/imageToBytes.js - Image XOR
src/utils/imageXor.js - AES file crypto
src/utils/aesFile.js - AES ECB images
src/utils/aesEcbImage.js - AES CBC images
src/utils/aesCbcImage.js
AES visualization
- AES step view
src/components/aes/SubBytesView.jsx - AES graph data
src/utils/aesViewData.js
Other components
- Learner
Connections 22
- Learner → Graph app: uses
README.md - Graph app → Graph inputs: renders
src/App.js - Graph app → Node palette: renders
src/App.js - Graph app → Mode selection: renders
src/App.js - Graph app → Mode presets: builds preset
src/App.js - Graph app → Graph evaluation: evaluates graph
src/App.js - Graph app → Cipher dispatch: dispatches cipher
src/App.js - Graph app → Connection checks: checks connections
src/App.js - Learner → Plaintext input: enters data
README.md - Graph app → Cipher node: renders
src/App.js - Graph app → Ciphertext output: renders
src/App.js - Cipher dispatch → Graph evaluation: evaluates XOR
src/utils/cipherHandlers/index.js - Cipher dispatch → XOR handler: runs image XOR
src/utils/cipherHandlers/index.js - Cipher dispatch → AES handler: runs image AES
src/utils/cipherHandlers/index.js - XOR handler → Image conversion: decodes image
src/utils/cipherHandlers/xorHandler.js - XOR handler → Image XOR: XORs pixels
src/utils/cipherHandlers/xorHandler.js - AES handler → Image conversion: decodes image
src/utils/cipherHandlers/aesHandler.js - AES handler → AES file crypto: encrypts files
src/utils/cipherHandlers/aesHandler.js - AES handler → AES ECB images: handles ECB images
src/utils/cipherHandlers/aesHandler.js - AES handler → AES CBC images: handles CBC images
src/utils/cipherHandlers/aesHandler.js - AES step view → AES graph data: reads graph data
src/components/aes/SubBytesView.jsx - AES graph data → Graph evaluation: derives graph state
src/utils/aesViewData.js