
PoC Python per la CVE-2026-23006, che dimostra un side-channel sulla lunghezza del ciphertext Kyber in grado di far trapelare bit della chiave segreta tramite analisi statistica di output a lunghezza variabile.
# kyber_length_leak.py - Leaks secret key bit based on ciphertext length
import random
# Simulate encapsulation: ciphertext length depends on message bit
def encapsulate(pk, bit):
# In a flawed implementation, the ciphertext size varies based on a secret bit
if bit:
return b'\x00' * 800 # long ciphertext
else:
return b'\x00' * 768 # short ciphertext
# Attacker observes lengths
lengths = []
for _ in range(100):
ct = encapsulate(None, random.randint(0,1))
lengths.append(len(ct))
# Histogram reveals two clusters -> secret bit leakage
print("Ciphertext lengths leak secret bit.")
Un'implementazione difettosa del meccanismo di incapsulamento della chiave Kyber produce testi cifrati di lunghezze diverse a seconda di un bit segreto nel segreto condiviso. Un attaccante che misura la lunghezza di più testi cifrati può recuperare il bit con un'analisi statistica.
Esegui la simulazione:
python kyber_length_leak.py
Osserva due gruppi distinti di lunghezze.