Hacking in Quantum

Hacking refers to gaining unauthorised data. The process can be classifies as active or passive:

  1. Active Attacks: Active hacking attacks is modifying or destroying information (similar to Deepfakes). The process is easy to detect but often causes immediate damage. Examples:
    • Man-in-the middle (hacking and modifying the information)
    • Denali service (where server is overloaded with payload)
  2. Passive Attacks:
    Passive hacking is collecting unauthorised data. The process is difficult to detect but also take longer time to leave a huger damage footprint. Examples:
    • Data leak and Doxing (accessing info and exposing it public)
    • Eavesdropping (gathering information in communication gateway)

Detecting Eave Dropping

Measurement Attack

Quantum protocols such as BB84 are often used in the process creating a secure public key. If in the process of sending Quantum information, eave dropping is done .i.e measurement is done on the qubits.

If the Qubits which are measured are sent to the receiver, the bits don’t match with transmitter as the bits were measured in wrong basis in the process of eave dropping.

Intercept and Resend Attack

If the Eave dropper decided to randomly choose the basis like Bob and perform measurement. After measuring, Eave dropper resend those bits to Bob converting them back to quantum states. Due to the probability of Quantum Physics, Eave dropper cannot always get the right basis hence unable to decrypt.

Now transmitter measures the qubits sent by Eave dropper. There would be clear difference in receiver’s bits (key) and transmitter’s bits even after the removal of the bits for which different basis were applied. This is due to the fact of No-cloning theorem. Eave dropper tried to clone his measurements and send it to the receiver. But after measurement due to probabilistic nature of Quantum Physics, the transmitter would not get the same bit even if same basis were applied.

Entanglement Attack

This approach is much more trickier compared to others. The Eave dropper does not measure this time rather adds a CX gate with transmitter’s bits as control and his bits as target.

Z Basis: Entanglement attack can extract information from Z Basis without being detected.

X Basis: If transmitter has applied X Basis to the bits and sends them. If the Eave dropper entangles the circuits, he is fundamentally changing the circuit. This means that the measurement of entangled version of circuit may be different from the measurement done to a non-entangled version. So the receiver and eave dropper gets incorrect information as the receiver cannot undo the H gate applied by transmitter.

Code Snippets (Cirq):

Creating entanglement

qubits = [cirq.NamedQubit("q0"), cirq.NamedQubit("q1")]
circuit = cirq.Circuit()

circuit.append(cirq.H(qubits[0]))
circuit.append(cirq.CNOT(qubits[0], qubits[1])) #control, target
circuit.append(cirq.X(qubits[1]))
circuit.append(cirq.measure(qubits))

# state_vector = cirq.final_state_vector(circuit)
simulator = cirq.Simulator()
result = sim.run(circuit, repetaions=1000)

historgram = cirq.plot_state_histogram(result, plt.subplot())
plt.show()