zwdz.py

class qAuth.nonEnt.zwdz.Authenticator(name)

Class for Authenticator

authenticate(key)

Method that takes care of authenticator’s job.

Parameters:key (str) – Secret Key Shared by two parties.
Returns:Result of authentication check.
Return type:Boolean
recvDecode(hash_value)

Method that receives the qubits, decodes it and checks for auth.

Parameters:hash_value (str) – Hash value produced by key and random_key.
Returns:Result of authentication check.
Return type:Boolean
recvRandom()

Method that receives the random number sent by prover.

Returns:Returns random key.
Return type:String
class qAuth.nonEnt.zwdz.Participants

Class which defines common functions. Prover and Authenticator inherit this class.

createHash(key, random_key)

Method that takes in key and random_key to produce 64 bit hex hash value.

Parameters:
  • key (str) – Secret Key Shared by two parties.
  • random_key (str) – Random key generated for this iteration for authentication.
Returns:

64 bit hex hash value.

Return type:

str

class qAuth.nonEnt.zwdz.Prover(name)

Class for Prover

authenticate(key, receiver)

Method that takes care of prover’s job.

Parameters:
  • key (str) – Secret Key Shared by two parties.
  • receiver (str) – Authenticator’s name.
createRandom()

Method that creates the random key for the iteration. Uses randomness of Quantum Mechanics to produce the required string.

Returns:Random key.
Return type:String
encodeSend(hash_value, receiver)

Method that encodes the hash key in Qubits.

Parameters:
  • hash_value (str) – Hash value produced by key and random_key.
  • receiver (str) – Authenticator’s name.
sendRandom(random_key, receiver)

Method that sends the random_key generated before. It convert the string type to suitable type so that we can send through the classical server provided by SimulaQron.

Parameters:
  • random_key (str) – Random key generated for this iteration for authentication.
  • receiver (str) – Authenticator’s name.