attacker has two capabilities, first of those is random-
substitution wherein the attacker’s main aim is to dis-
rupt the key exchange process by randomly dropping
qubits and introducing new ones and the second is
called intercept-resend wherein the attacker takes a
qubit makes an observation and re-sends the qubit to
the intended destination. In this type of attack the
main motive is to gain information about the key be-
ing exchanged. We analyse how the protocols per-
form in both these settings.
3 FORMALISING IN CQP
A brief overview of CQP calculus is provided and
then we proceed to formalise both the protocols in
CQP. An example of BB84-Bit Commitment Proto-
col in CQP(Gay and Nagarajan, 2005) was given by
Simon and Gay and our formalisation uses the same
techniques.
A protocol at any given point of time has mul-
tiple participants, like Alice and Bob which are le-
gitimate entities involved and also adversaries like
Eve. These entities are collectively known as agents.
Agents communicate with each other via communi-
cation channels to exchange information. The work-
ing of the agents is encapsulated by processes. Every
agent has more than one process, and at any given
time its possible that more than one process is in ac-
tion. These processes can be reasonably thought of as
states in finite state automata and every process tran-
sitions to another or terminates. CQP allows us to
impose a probabilistic distribution across these tran-
sitions. Also processes in CQP can be parameterised.
1. channels are declared by the new keyword.
For example to declare a new qubit channel, we
write (new qubitChannel:ˆ[Qbit]), where Qbit is
the data type qubitChannel is constrained to and
’ˆ’ identifies it as a channel.
2. variables can be declared within a process like so,
(qbit q).
3. Process Output: c![x].P
i+1
to send the data stored
by variable x along channel c and then proceed
with process P
i+1
.
4. Process Input: c?[x].P
i+1
to receive along channel
c and then proceed with process P
i+1
.
5. Process action: e.P
i+1
evaluates expression e and
then proceeds with process P
i+1
6. Process decision: if e thenP
i+1
elseP
i+2
if the
expression e evaluates to true then proceed with
process P
i+1
else P
i+2
7. Terminate: P
i
.0 the process terminates after P
i
.
3.1 Formalising BB84
We identify that Alice, Bob are the primary agents of
the protocol and to analyse the effects of an eaves-
dropper, Eve becomes an agent of the system as well.
As described above channels can only transport mes-
sages of a particular type. We have qubitChannel
to transport qubits, intChannel for integers and deci-
sionChannel, decisionFlagChannel, randomBitChan-
nel for bits. Technically one bit channel would suf-
fice.
However having two different channels that are
used at two different stages in the protocol helps us to
convert the CQP-model into PRISM as will be elab-
orated in the next section. We have also made use of
List type, with its associated functions of hd, tl, [] and
@ for reading the first element, dropping the first ele-
ment, an empty list and placing data at the tail of the
list respectively. The use of these functions is demon-
strated by Gay et al.(Gay and Nagarajan, 2005).
• System is parameterised by a bitList, which consti-
tutes the classical bits that need to be exchanged
between Alice and Bob Random agent creates a
random bit and sends it via the radomBitChannel
Alice first sends the length of the number of bits
to be exchanged with Bob, i.e the length of bitList.
Upon sending the length of the bit list, Alice con-
tinues with the process AliceSend. This is a recur-
sive process which terminates after sending all the
bits in bitList. AliceSend first receives a random
bit from randomBitChannel, if the value received
is equal to zero then the qubit q is encoded in the
rectilinear basis else it is encoded in the diagonal
basis. (qubit q) creates a new qubit q initialised to
|
0
i
. Hence an operation of X on q to create
|
1
i
and X or X,H to convert it into
|
+
i
and
|
−
i
re-
spectively. AliceSend then sends the qubit q via
qubitChannel to be received by Bob. The random
bits are stored in encodeBitList to be used later
when both the entities decide upon the key.
• Bob receives the length of the bitList and then con-
tinues with BobReceive process. Like AliceSend,
this is a recursive process which terminates after
receiving all the bits. BobReceive then uses a ran-
dom bit from randomBitChannel, if this bit is zero
then Bob measures the received qubit in the recti-
linear basis else in the diagonal basis. We used a
list that stores a couplet, where we store the ran-
dom bit and the corresponding measurement.
• After exchanging the qubits, Alice and Bob con-
tinue with AliceReveal and BobFinal respectively.
AliceReveal sends the basis that she used for en-
coding via the decisionBitChannel. BobFinal upon
Modelling of Quantum Key Distribution Protocols in Communicating Quantum Processes Language with Verification and Analysis in
PRISM
77