# irfanshadikrishad/cipher architecture

> Architecture diagram of the GitHub repository irfanshadikrishad/cipher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/irfanshadikrishad/cipher
- Repository: https://github.com/irfanshadikrishad/cipher

## Overview

This is a dependency-free Node.js cipher library. The principal workflow is that an application imports the `Cipher` API, selects an exposed algorithm, constructs it with its key material, and calls encryption or decryption. The implementations span classical substitution, transposition and fractionation, symmetric, and public-key techniques. The graph shows the package’s registration relationships documented in `src/index.ts`; it does not imply that the algorithms call one another. The sampled source is partial, so internal algorithm details are not expanded.

Main entry points: [`src/index.ts`](https://github.com/irfanshadikrishad/cipher/blob/master/src/index.ts) (Package entry), [`src/Cipher.ts`](https://github.com/irfanshadikrishad/cipher/blob/master/src/Cipher.ts) (Cipher API), [`src/ciphers/Caesar.ts`](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Caesar.ts) (Caesar), [`src/ciphers/Atbash.ts`](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Atbash.ts) (Atbash)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Library API"]
  node_cipher_api["Cipher API<br/>[Cipher.ts]"]
  node_package_entry["Package entry<br/>[index.ts]"]
end

subgraph group_classical["Classical Ciphers"]
  node_caesar["Caesar<br/>[Caesar.ts]"]
  node_atbash["Atbash<br/>[Atbash.ts]"]
  node_rot13["ROT13<br/>[ROT13.ts]"]
  node_affine["Affine<br/>[Affine.ts]"]
  node_vigenere["Vigenère<br/>[Vigenere.ts]"]
  node_alphabet["Alphabet<br/>[Alphabet.ts]"]
  node_beaufort["Beaufort<br/>[Beaufort.ts]"]
  node_autokey["Autokey<br/>[Autokey.ts]"]
end

subgraph group_fractionation["Fractionation Ciphers"]
  node_playfair["Playfair<br/>[Playfair.ts]"]
  node_railfence["Rail Fence<br/>[RailFence.ts]"]
  node_columnar["Columnar"]
  node_adfgvx["ADFGVX<br/>[ADFGVX.ts]"]
  node_bifid["Bifid<br/>[Bifid.ts]"]
  node_nihilist["Nihilist<br/>[Nihilist.ts]"]
end

subgraph group_symmetric["Symmetric Ciphers"]
  node_rc4["RC4<br/>[RC4.ts]"]
  node_salsa20["Salsa20<br/>[Salsa20.ts]"]
  node_chacha20["ChaCha20<br/>[ChaCha20.ts]"]
  node_blowfish["Blowfish<br/>[Blowfish.ts]"]
  node_des["DES<br/>[DES.ts]"]
  node_aes["AES<br/>[AES.ts]"]
  node_aesgcm["AES-GCM<br/>[AESGCM.ts]"]
end

subgraph group_publickey["Public-Key Ciphers"]
  node_ecc["ECC<br/>[ECC.ts]"]
  node_rsa["RSA<br/>[RSA.ts]"]
end

node_application(("Node.js application"))

node_application -->|"imports"| node_package_entry
node_package_entry -->|"exports"| node_cipher_api
node_package_entry -->|"registers"| node_caesar
node_package_entry -->|"registers"| node_atbash
node_package_entry -->|"registers"| node_rot13
node_package_entry -->|"registers"| node_affine
node_package_entry -->|"registers"| node_vigenere
node_package_entry -->|"registers"| node_alphabet
node_package_entry -->|"registers"| node_beaufort
node_package_entry -->|"registers"| node_autokey
node_package_entry -->|"registers"| node_playfair
node_package_entry -->|"registers"| node_railfence
node_package_entry -->|"registers"| node_columnar
node_package_entry -->|"registers"| node_adfgvx
node_package_entry -->|"registers"| node_bifid
node_package_entry -->|"registers"| node_nihilist
node_package_entry -->|"registers"| node_rc4
node_package_entry -->|"registers"| node_salsa20
node_package_entry -->|"registers"| node_chacha20
node_package_entry -->|"registers"| node_blowfish
node_package_entry -->|"registers"| node_des
node_package_entry -->|"registers"| node_aes
node_package_entry -->|"registers"| node_aesgcm
node_package_entry -->|"registers"| node_ecc
node_package_entry -->|"registers"| node_rsa

click node_cipher_api "https://github.com/irfanshadikrishad/cipher/blob/master/src/Cipher.ts"
click node_package_entry "https://github.com/irfanshadikrishad/cipher/blob/master/src/index.ts"
click node_caesar "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Caesar.ts"
click node_atbash "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Atbash.ts"
click node_rot13 "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ROT13.ts"
click node_affine "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Affine.ts"
click node_vigenere "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Vigenere.ts"
click node_alphabet "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Alphabet.ts"
click node_beaufort "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Beaufort.ts"
click node_autokey "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Autokey.ts"
click node_playfair "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Playfair.ts"
click node_railfence "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/RailFence.ts"
click node_columnar "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ColumnarTransposition.ts"
click node_adfgvx "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ADFGVX.ts"
click node_bifid "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Bifid.ts"
click node_nihilist "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Nihilist.ts"
click node_rc4 "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/RC4.ts"
click node_salsa20 "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Salsa20.ts"
click node_chacha20 "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ChaCha20.ts"
click node_blowfish "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Blowfish.ts"
click node_des "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/DES.ts"
click node_aes "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/AES.ts"
click node_aesgcm "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/AESGCM.ts"
click node_ecc "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ECC.ts"
click node_rsa "https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/RSA.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cipher_api,node_package_entry toneBlue
class node_caesar,node_atbash,node_rot13,node_affine,node_vigenere,node_alphabet,node_beaufort,node_autokey toneAmber
class node_playfair,node_railfence,node_columnar,node_adfgvx,node_bifid,node_nihilist toneMint
class node_rc4,node_salsa20,node_chacha20,node_blowfish,node_des,node_aes,node_aesgcm toneRose
class node_ecc,node_rsa,node_application toneIndigo
```

## Components

### Library API

- [Cipher API](https://github.com/irfanshadikrishad/cipher/blob/master/src/Cipher.ts): `src/Cipher.ts`
- [Package entry](https://github.com/irfanshadikrishad/cipher/blob/master/src/index.ts): `src/index.ts`

### Classical Ciphers

- [Caesar](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Caesar.ts): `src/ciphers/Caesar.ts`
- [Atbash](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Atbash.ts): `src/ciphers/Atbash.ts`
- [ROT13](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ROT13.ts): `src/ciphers/ROT13.ts`
- [Affine](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Affine.ts): `src/ciphers/Affine.ts`
- [Vigenère](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Vigenere.ts): `src/ciphers/Vigenere.ts`
- [Alphabet](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Alphabet.ts): `src/ciphers/Alphabet.ts`
- [Beaufort](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Beaufort.ts): `src/ciphers/Beaufort.ts`
- [Autokey](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Autokey.ts): `src/ciphers/Autokey.ts`

### Fractionation Ciphers

- [Playfair](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Playfair.ts): `src/ciphers/Playfair.ts`
- [Rail Fence](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/RailFence.ts): `src/ciphers/RailFence.ts`
- [Columnar](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ColumnarTransposition.ts): `src/ciphers/ColumnarTransposition.ts`
- [ADFGVX](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ADFGVX.ts): `src/ciphers/ADFGVX.ts`
- [Bifid](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Bifid.ts): `src/ciphers/Bifid.ts`
- [Nihilist](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Nihilist.ts): `src/ciphers/Nihilist.ts`

### Symmetric Ciphers

- [RC4](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/RC4.ts): `src/ciphers/RC4.ts`
- [Salsa20](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Salsa20.ts): `src/ciphers/Salsa20.ts`
- [ChaCha20](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ChaCha20.ts): `src/ciphers/ChaCha20.ts`
- [Blowfish](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/Blowfish.ts): `src/ciphers/Blowfish.ts`
- [DES](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/DES.ts): `src/ciphers/DES.ts`
- [AES](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/AES.ts): `src/ciphers/AES.ts`
- [AES-GCM](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/AESGCM.ts): `src/ciphers/AESGCM.ts`

### Public-Key Ciphers

- [ECC](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/ECC.ts): `src/ciphers/ECC.ts`
- [RSA](https://github.com/irfanshadikrishad/cipher/blob/master/src/ciphers/RSA.ts): `src/ciphers/RSA.ts`

### Other components

- **Node.js application**

## Connections

- Node.js application → Package entry: imports (evidence: `README.md`)
- Package entry → Cipher API: exports (evidence: `src/index.ts`)
- Package entry → Caesar: registers (evidence: `src/index.ts`)
- Package entry → Atbash: registers (evidence: `src/index.ts`)
- Package entry → ROT13: registers (evidence: `src/index.ts`)
- Package entry → Affine: registers (evidence: `src/index.ts`)
- Package entry → Vigenère: registers (evidence: `src/index.ts`)
- Package entry → Alphabet: registers (evidence: `src/index.ts`)
- Package entry → Beaufort: registers (evidence: `src/index.ts`)
- Package entry → Autokey: registers (evidence: `src/index.ts`)
- Package entry → Playfair: registers (evidence: `src/index.ts`)
- Package entry → Rail Fence: registers (evidence: `src/index.ts`)
- Package entry → Columnar: registers (evidence: `src/index.ts`)
- Package entry → ADFGVX: registers (evidence: `src/index.ts`)
- Package entry → Bifid: registers (evidence: `src/index.ts`)
- Package entry → Nihilist: registers (evidence: `src/index.ts`)
- Package entry → RC4: registers (evidence: `src/index.ts`)
- Package entry → Salsa20: registers (evidence: `src/index.ts`)
- Package entry → ChaCha20: registers (evidence: `src/index.ts`)
- Package entry → Blowfish: registers (evidence: `src/index.ts`)
- Package entry → DES: registers (evidence: `src/index.ts`)
- Package entry → AES: registers (evidence: `src/index.ts`)
- Package entry → AES-GCM: registers (evidence: `src/index.ts`)
- Package entry → ECC: registers (evidence: `src/index.ts`)
- Package entry → RSA: registers (evidence: `src/index.ts`)
