# megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman architecture

> Architecture diagram of the GitHub repository megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman
- Repository: https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman

## Overview

This Streamlit application encrypts secret messages, embeds them in images, and supports extraction, decryption, image analysis, and JPEG fragility testing. The main workflow runs from user input through ElGamal encryption and Reed-Solomon-protected, randomized LSB embedding to a downloadable stego image; extraction reverses those stages. The README documents the product branches, and the SOURCE INDEX confirms app.py references the three core modules. Source excerpts are partial, so some links rely on documented workflows rather than inspected call sites.

Main entry points: [`app.py`](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py) (Analysis tab), [`steganography.py`](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/steganography.py) (RS and LSB-PRNG), [`elgamal.py`](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/elgamal.py) (ElGamal-DH), [`analysis.py`](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py) (Image metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Streamlit workflows"]
  node_app["Web interface<br/>[app.py]"]
  node_encrypt["Encrypt workflow<br/>[app.py]"]
  node_extract["Extract workflow<br/>[app.py]"]
  node_analysis_tab["Analysis tab<br/>[app.py]"]
  node_jpeg_tab["JPEG test tab<br/>[app.py]"]
end

subgraph group_crypto["Cryptographic processing"]
  node_elgamal["ElGamal-DH<br/>[elgamal.py]"]
end

subgraph group_stego["Image payload"]
  node_ecc_lsb["RS and LSB-PRNG<br/>[steganography.py]"]
  node_stego_image["Stego image"]
end

subgraph group_inspection["Analysis and testing"]
  node_metrics["Image metrics<br/>[analysis.py]"]
  node_histograms["Histogram analysis<br/>[analysis.py]"]
  node_visual_analysis["LSB and heatmap<br/>[analysis.py]"]
  node_chi_square["Chi-square analysis<br/>[analysis.py]"]
  node_jpeg_sim["JPEG simulation<br/>[analysis.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"offers"| node_encrypt
node_app -->|"offers"| node_extract
node_app -->|"offers"| node_analysis_tab
node_app -->|"offers"| node_jpeg_tab
node_encrypt -->|"encrypts message"| node_elgamal
node_encrypt -->|"protects and embeds"| node_ecc_lsb
node_ecc_lsb -->|"produces"| node_stego_image
node_extract -->|"extracts and corrects"| node_ecc_lsb
node_extract -->|"decrypts payload"| node_elgamal
node_extract -->|"reads"| node_stego_image
node_analysis_tab -->|"calculates"| node_metrics
node_analysis_tab -->|"renders"| node_histograms
node_analysis_tab -->|"renders"| node_visual_analysis
node_analysis_tab -->|"runs"| node_chi_square
node_jpeg_tab -->|"simulates compression"| node_jpeg_sim
node_jpeg_tab -->|"tests extraction"| node_ecc_lsb
node_analysis_tab -->|"compares with cover"| node_stego_image

click node_app "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py"
click node_encrypt "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py"
click node_extract "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py"
click node_analysis_tab "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py"
click node_jpeg_tab "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py"
click node_elgamal "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/elgamal.py"
click node_ecc_lsb "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/steganography.py"
click node_metrics "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py"
click node_histograms "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py"
click node_visual_analysis "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py"
click node_chi_square "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py"
click node_jpeg_sim "https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py"

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_app,node_encrypt,node_extract,node_analysis_tab,node_jpeg_tab,node_user toneBlue
class node_elgamal toneAmber
class node_ecc_lsb,node_stego_image toneMint
class node_metrics,node_histograms,node_visual_analysis,node_chi_square,node_jpeg_sim toneRose
```

## Components

### Streamlit workflows

- [Web interface](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py): `app.py`
- [Encrypt workflow](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py): `app.py`
- [Extract workflow](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py): `app.py`
- [Analysis tab](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py): `app.py`
- [JPEG test tab](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/app.py): `app.py`

### Cryptographic processing

- [ElGamal-DH](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/elgamal.py): `elgamal.py`

### Image payload

- [RS and LSB-PRNG](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/steganography.py): `steganography.py`
- **Stego image**

### Analysis and testing

- [Image metrics](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py): `analysis.py`
- [Histogram analysis](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py): `analysis.py`
- [LSB and heatmap](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py): `analysis.py`
- [Chi-square analysis](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py): `analysis.py`
- [JPEG simulation](https://github.com/megatruh/steganografi-dengan-enkripsi-elgamal-berbasis-diffie-hellman/blob/main/analysis.py): `analysis.py`

### Other components

- **User**

## Connections

- User → Web interface: uses (evidence: `README.md`)
- Web interface → Encrypt workflow: offers (evidence: `README.md`)
- Web interface → Extract workflow: offers (evidence: `README.md`)
- Web interface → Analysis tab: offers (evidence: `README.md`)
- Web interface → JPEG test tab: offers (evidence: `README.md`)
- Encrypt workflow → ElGamal-DH: encrypts message (evidence: `README.md`)
- Encrypt workflow → RS and LSB-PRNG: protects and embeds (evidence: `README.md`)
- RS and LSB-PRNG → Stego image: produces (evidence: `README.md`)
- Extract workflow → RS and LSB-PRNG: extracts and corrects (evidence: `README.md`)
- Extract workflow → ElGamal-DH: decrypts payload (evidence: `README.md`)
- Extract workflow → Stego image: reads (evidence: `README.md`)
- Analysis tab → Image metrics: calculates (evidence: `README.md`)
- Analysis tab → Histogram analysis: renders (evidence: `README.md`)
- Analysis tab → LSB and heatmap: renders (evidence: `README.md`)
- Analysis tab → Chi-square analysis: runs (evidence: `README.md`)
- JPEG test tab → JPEG simulation: simulates compression (evidence: `README.md`)
- JPEG test tab → RS and LSB-PRNG: tests extraction (evidence: `README.md`)
- Analysis tab → Stego image: compares with cover (evidence: `README.md`)
