CoNaIISI 2026 Submitted · UTN FRRo

Quantum key distribution,
observable qubit by qubit.

Q-Sec simulates the BB84 protocol on IBM Qiskit Aer — single-photon state preparation, depolarizing channel noise and intercept-resend attacks — and measures exactly when a key stops being secret.

No account required Qiskit 2.2 · Aer 0.17 Test-covered quantum core

quantum channel

LIVE
Alice PREPARE Bob MEASURE SINGLE-PHOTON POLARIZATION STATES
Qubits / run
10 – 1,000
Prepared & measured on Aer
Channel model
Depolarizing
qiskit_aer.noise, ε ∈ [0, 1]
Abort threshold
11.0%
Shor–Preskill QBER bound
Attack model
Intercept–resend
E[QBER] = 25% on ideal fiber
Protocol

Four stages from random bits to a provably secret key.

Security rests on physics, not on computational hardness: measuring an unknown quantum state disturbs it, and that disturbance is measurable.

01 · ALICE

State preparation

Random bits $b_i$ are encoded in a random basis — rectilinear $\{|0\rangle,|1\rangle\}$ or diagonal $\{|+\rangle,|-\rangle\}$.

02 · CHANNEL

Quantum transmission

Photons cross a depolarizing channel $\mathcal{E}_\varepsilon(\rho)$ where an adversary may intercept and resend them.

03 · BOB

Measurement & sifting

Bob measures in his own random bases. Over a public channel both keep only positions where the bases agree (~50%).

04 · DISTILL

Key-rate estimation

A sacrificed sample estimates the QBER. Below 11%, a secret key survives at rate $R \ge 1 - 2h(\text{QBER})$.

Security bound

Where secrecy ends.

Every error Bob sees could have leaked to Eve. Error correction plus privacy amplification can remove that leakage — but only while the error rate stays under the Shor–Preskill threshold.

Asymptotic secret key rate
$$R = \max\bigl(0,\; 1 - 2\,h(Q)\bigr)$$
Binary Shannon entropy
$$h(p) = -p\log_2 p - (1-p)\log_2(1-p)$$
0%10%20%30%
Experiments

Three scenarios, one click each.

Calibrated configurations that land on each side of the security threshold.

Custom parameters
Baseline 01

Ideal channel

Noiseless fiber, no adversary. Bob recovers Alice’s sifted bits exactly.

Qubits128
Eveoff
Noise ε0.00
Expected QBER0%
Run baseline
Active threat 02

Intercept–resend attack

Eve measures every photon in a random basis and resends it, disturbing half of them.

Qubits128
Eveon
Noise ε0.00
Expected QBER25%
Simulate attack
Decoherence 03

Noisy channel

Strong depolarizing noise, no adversary. Indistinguishable from an attack — so it aborts too.

Qubits128
Eveoff
Noise ε0.40
Expected QBER20%
Inject noise
Engineering

A clean three-layer system behind the physics.

Presentation, quantum domain and persistence are strictly decoupled: the views never touch the database, and the simulation core is framework-agnostic and fully unit-tested.

Explore the architecture
PresentationFlask routes, guest mode, REST API, SVG photon engine
views/
Quantum domainQiskit circuits, Aer noise models, QBER & key-rate estimation
business/
DataRepository pattern, SQLite / PostgreSQL, idempotent schema evolution
datos/

Run your first key exchange.

No sign-up needed. Create an account only if you want your experiments saved to a personal history.