How kamaleshs-23/crypt_learn works
Purpose and Entry Points
This is a static, browser-based cryptography learning tool. It implements classical ciphers plus DES, simplified DES (S-DES), and AES, with interactive encryption/decryption and algorithm visualizations.
Primary browser entry points:
• index.html supplies the application structure.
• script.js coordinates UI behavior and algorithm selection.
• style.css defines presentation.
UI-to-Algorithm Dispatch
The application is organized around selecting a cipher, collecting plaintext/key inputs, and invoking the corresponding module. script.js is the central integration boundary between DOM events and cryptographic implementations.
Relevant paths:
• script.js
• index.html
• modules/visualizations.js
Classical Cipher Implementations
Independent modules implement traditional substitution, transposition, and polyalphabetic algorithms. These are likely direct computational units consumed by the UI dispatcher, without a shared server or persistence layer.
Core paths:
• modules/ceaser.js
• modules/vigenere.js
• modules/monoalphabetic.js
• modules/playfair.js
• modules/hillcipher.js
• modules/railfence.js
• modules/columnar.js
• modules/product.js
• modules/otp.js
DES and S-DES Processing
DES-family functionality is separated into algorithm engines and visualization-oriented modules. This establishes a useful boundary: cryptographic transformations compute values, while flow modules expose intermediate rounds, permutations, keys, or diagrams for the browser UI.
Core paths:
• modules/des.js
• modules/sdes.js
• modules/des-visualization.js
• modules/sdes-visualization.js
• modules/des-flow-diagrams.js
• modules/des-unified-flow.js
AES Processing and Visualization
AES follows the same engine/presentation split as DES. The AES implementation is isolated from its explanatory visualization layer, allowing the UI to show state transformations independently of the core cipher operations.
Core paths:
• modules/aes.js
• modules/aes-visualization.js
Visualization Layer
Visualization modules are a major architectural concern rather than incidental UI decoration: they translate cipher stages into browser-renderable explanations. The generic visualization module appears to support shared display behavior, while DES/AES-specific modules provide algorithm-specific flows.
Relevant paths:
• modules/visualizations.js
• modules/des-visualization.js
• modules/aes-visualization.js
• modules/des-flow-diagrams.js
Runtime and External Boundaries
The repository contains only client-side HTML, CSS, and JavaScript. It has no visible backend, package manifest, build system, database, API client, or external service integration. Execution occurs in the browser, with local DOM state as the primary control and presentation boundary.
A focused S-DES test harness is present:
• test-sdes.js
Main entry points: script.js UI dispatcher · des-visualization.js DES visualization · visualizations.js Shared visualizations · index.html Application page
Components 19
Browser Application
Client-side entry and interaction layer.
- Application page
index.html - Presentation
style.css - UI dispatcher · Collects inputs, selects algorithms, and updates the DOM.
script.js
Classical Ciphers
Independent cipher computation modules.
- Caesar cipher
modules/ceaser.js - Vigenère cipher
modules/vigenere.js - Monoalphabetic cipher
modules/monoalphabetic.js - Playfair cipher
modules/playfair.js - Hill cipher
modules/hillcipher.js - Transposition ciphers · Rail fence, columnar, and product cipher implementations.
modules/railfence.js - One-time pad
modules/otp.js
DES, S-DES & AES
Cipher engines and algorithm-specific explanatory flows.
- DES engine
modules/des.js - S-DES engine
modules/sdes.js - AES engine
modules/aes.js
Visualization Layer
Browser-renderable algorithm explanations.
- Shared visualizations
modules/visualizations.js - DES visualization · Exposes DES stages and intermediate values.
modules/des-visualization.js - S-DES visualization
modules/sdes-visualization.js - DES flow diagrams
modules/des-flow-diagrams.js - Unified DES flow
modules/des-unified-flow.js - AES visualization · Explains AES state transformations.
modules/aes-visualization.js
Connections 20
- Application page → UI dispatcher: loads
- Application page → Presentation: styles
- UI dispatcher → Caesar cipher: dispatches
- UI dispatcher → Vigenère cipher: dispatches
- UI dispatcher → Monoalphabetic cipher: dispatches
- UI dispatcher → Playfair cipher: dispatches
- UI dispatcher → Hill cipher: dispatches
- UI dispatcher → Transposition ciphers: dispatches
- UI dispatcher → One-time pad: dispatches
- UI dispatcher → DES engine: dispatches
- UI dispatcher → S-DES engine: dispatches
- UI dispatcher → AES engine: dispatches
- UI dispatcher → Shared visualizations: renders explanations
- DES engine → DES visualization: provides stages
- S-DES engine → S-DES visualization: provides stages
- AES engine → AES visualization: provides state changes
- DES visualization → DES flow diagrams: renders diagrams
- DES visualization → Unified DES flow: renders flow
- Shared visualizations → DES visualization: supports
- Shared visualizations → AES visualization: supports