Secure Transmission Protocol Simulator

Security Engineering · Networking · Cryptography · Reliability

The Secure Transmission Protocol Simulator is a Python/PySide6 desktop application built to make the entire secure-transmission pipeline visible. Instead of demonstrating encryption, error correction and retransmission independently, the application connects them into one inspectable sender → channel → receiver workflow.

AES-CBC128 / 192 / 256-bit key modes
Hamming + CRCcorrection versus detection strategies
ACK / NACKautomatic retransmission control
6 UI tabssimulation, frames, stats, comparison, logs, settings
Plaintext→Encrypt→Error coding→Noisy channel→Validate / correct→ACK or NACK→Decrypt
Engineering goal: show how confidentiality and reliability solve different problems. Encryption protects message content, while coding, integrity checks and retransmission handle corruption introduced by an unreliable channel.

1. Architecture

The application is divided into separate layers for cryptography, coding, the channel model, sender/receiver protocol logic, analytics and the desktop UI. That separation makes it possible to test each layer independently while also validating the complete transmission path.

Secure transmission simulator architecture
Application architecture. Encryption, coding, channel corruption, receiver decisions and retransmission are modeled as distinct stages instead of being mixed into the user interface.

2. Encryption layer

The simulator supports two encryption choices:

  • AES-CBC, with 128-, 192- or 256-bit keys;
  • a substitution cipher for simpler comparative experiments.

The AES path uses pycryptodome. Encryption happens before the reliability layer, so the payload travelling through the noisy channel is encrypted data rather than plaintext.

This distinction is important: AES does not correct transmission errors. A corrupted ciphertext can fail to decrypt correctly even though the cryptographic algorithm itself is functioning as designed. The reliability mechanisms therefore operate alongside encryption rather than replacing it.

3. Error coding: Hamming(7,4) versus CRC

The application exposes two different reliability strategies.

Hamming(7,4)

Hamming coding adds parity information that lets the receiver identify and correct a single-bit error in the supported model. It demonstrates forward error correction: some corruption can be repaired without asking the sender to retransmit.

CRC

CRC is used for error detection. It lets the receiver identify that a frame changed in transit, but it does not reconstruct the original corrupted bits by itself. When CRC validation fails, the protocol can issue a NACK and trigger retransmission.

Putting both options in the same simulator makes the trade-off visible: one strategy spends redundancy on local correction; the other relies on detection plus retransmission.

4. Noisy-channel model

The channel layer deliberately introduces controlled corruption so the protocol can be tested under repeatable conditions.

The supported error modes are:

Mode Behavior
NONE no errors are introduced
SINGLE at most one random bit is flipped per frame
MULTI each bit can be flipped independently using probability p
BURST a contiguous sequence of bits is corrupted

A configurable random seed makes experiments reproducible. This means a comparison between two coding strategies can use the same channel conditions instead of relying on different random error patterns.

5. Sender, receiver and ACK/NACK logic

The protocol layer models a complete delivery decision:

  1. The sender encrypts and encodes the frame.
  2. The channel injects the configured errors.
  3. The receiver validates or corrects the frame.
  4. A valid frame produces an ACK.
  5. A detected invalid frame produces a NACK.
  6. The retransmission controller retries until the frame succeeds or the retry limit is reached.

This lets the project demonstrate reliability as a stateful protocol behavior rather than a one-line checksum calculation.

Simulation control room
Simulation control room. The user chooses message, encryption, coding scheme, channel error model and probability, then observes the resulting transmission and ACK/NACK state.

6. Frame-by-frame inspection

One of the most useful parts of the application is the ability to inspect each transformation in the transmission chain. The Frame Analysis view shows the progression from original plaintext through encrypted and encoded forms, then the noisy/corrected frame and final recovered message.

Transmission stages
Transmission stages. Each representation is visible side-by-side so it is possible to identify where encryption, coding, corruption and correction take effect.

The binary inspector goes further by highlighting parity positions, channel-modified bits and Hamming-corrected bits.

Binary frame inspector
Bit-level frame inspector. Changed and corrected bits are highlighted so the error-control behavior is directly observable rather than inferred from a final success message.

7. Protocol event logging

The application records a chronological event trail for transmission preparation, sending, channel activity, ACK/NACK decisions, retries and dropped frames.

Protocol event logs
Protocol log. The event timeline makes retransmission behavior auditable and can be searched or exported for later analysis.

This is useful because a final message status alone does not explain why delivery required multiple attempts or where the corruption occurred.

8. Reliability analytics

The Statistics view tracks session-level metrics such as:

  • bit error rate (BER);
  • throughput;
  • retransmission count/rate;
  • detected versus corrected errors;
  • transmission success rate.
Network reliability dashboard
Reliability dashboard. Matplotlib charts turn individual frame outcomes into session-wide metrics, making it easier to compare channel conditions and protocol choices.

9. Experiment comparison mode

The comparison runner automates experiments across four combinations:

  • AES + Hamming;
  • AES + CRC;
  • Substitution + Hamming;
  • Substitution + CRC.

The important part is that the combinations can be tested under the same channel settings. This allows a more meaningful comparison of retransmissions, correction behavior and success rates.

Experiment matrix
Experiment matrix. Multiple encryption/coding combinations can be executed under comparable error conditions and reviewed side-by-side.

10. Persistent configuration

The Settings tab stores defaults such as encryption mode, coding scheme, retry limit, theme and error probability using Qt settings. This prevents repeated manual setup and gives experiments a stable starting configuration.

Simulator settings
Persistent settings. Experiment defaults are saved between sessions instead of being hard-coded into the application.

11. Code organization

The repository separates the major responsibilities:

  • core/crypto/ — AES and substitution encryption;
  • core/coding/ — Hamming and CRC;
  • core/channel/ — channel and error models;
  • core/protocol/ — sender, receiver, ACK/NACK and retransmission;
  • core/analytics/ — metrics, charts and experiment runner;
  • ui/ — PySide6 tabs, widgets and dialogs;
  • tests/ — unit and end-to-end validation.

That structure keeps the GUI from becoming the protocol implementation. The same core logic can be tested without clicking through the interface.

12. Automated testing

The pytest suite covers the critical behaviors documented in the repository:

  • AES encrypt/decrypt round trips;
  • Hamming encode/decode and single-bit correction;
  • CRC generation and verification;
  • channel error injection;
  • sender/receiver ACK/NACK behavior;
  • end-to-end transmission integration.

This matters particularly for a simulator: a visualization can look plausible even when the underlying protocol logic is wrong, so core behavior needs test coverage independent of the UI.

13. What the project demonstrates

The project brings together several topics that are often taught independently:

  • symmetric cryptography;
  • error detection and correction;
  • network/channel simulation;
  • retransmission protocol state;
  • reproducible experiments;
  • desktop application engineering;
  • analytics and visualization;
  • automated testing.
Scope boundary: this is an educational engineering simulator. It demonstrates protocol concepts and software architecture; it is not presented as a production replacement for established transport-security protocols such as TLS.