abenc_accountability_jyjxgd20

ABE with Privacy Protection and Accountability (JYJXGD20)

Authors: Jiguo Li, Yichen Zhang, Jianting Ning, Xinyi Huang, Geong Sen Poh, Debang Wang

Title: “Attribute Based Encryption with Privacy Protection and Accountability for CloudIoT”
Published in: IEEE Transactions on Cloud Computing, 2020
Notes: Two schemes implemented: (1) CP policy hiding (class CP_Hiding_ABE), (2) CP policy hiding with accountability under white box assumption (class CP_Hiding_Accountability_ABE)

Scheme Properties

  • Type: ciphertext-policy attribute-based encryption (public key)

  • Setting: Pairing groups

  • Assumption: Decisional Bilinear Diffie-Hellman

Implementation

Authors:

Ahmed Bakr

Date:

08/2023

class abenc_accountability_jyjxgd20.Attribute(attr_name, values_list: List[str] = [])[source]

Bases: object

add_value(value: str)[source]
get_attribute_values_full_name()[source]

Attribute values full name is in the following format: ‘attrName_value’

static get_full_attribute_value_name(attr_name: str, value_name: str)[source]
set_values(values_list: List[str])[source]
class abenc_accountability_jyjxgd20.CP_Hiding_ABE(group_obj)[source]

Bases: ABEnc

Cipher text policy hiding attribute based encryption (Section 3 in the paper).

decrypt(CT, PK, SK)[source]

Decrypt a cipher text. This algorithm is performed by a data user who has the required attributes to decipher the ciphertext that was encrypted using an access policy. Inputs:

  • CT: Cipher text.

  • PK: Public parameters and the public key of the TA.

  • SK: User’s secret key.

Outputs:
  • m: The original decrypted message.

encrypt(m, PK, access_policy: Dict[str, List[str]])[source]

Encrypt a message using an access policy. This function is performed by a data user who wants to encrypt his message with an access policy. They consider only and-gates in their policy. Note: The access policy is hidden into the ciphertext. Inputs:

  • PK: Public parameters and the public key of the TA.

  • m: Message to be encrypted in G_T.

  • access_policy: Access policy that will be used to encrypt the message. It has to be and gated policy,

    which means that each attribute can have only one value.

Outputs:
  • CT: Cipher text.

key_gen(MSK, PK, attributes_list)[source]

Key generation for a user based on his list of attributes. This algorithm is performed by TA. Inputs:

  • MSK: Master Secret Key of the TA.

  • PK: Public parameters and the public key of the TA.

  • attributes_list: List of attributes held by this user, where each attribute is in the format:

    ‘attrName_value’

Outputs:
  • SK: User’s secret key.

setup(attributes_dict: Dict[str, List[str]])[source]

System Setup algorithm. This algorithm is performed by TA. Inputs:

  • None

Outputs:
  • MSK: TA’s master secret key.

  • PK: Public Parameters.

class abenc_accountability_jyjxgd20.CP_Hiding_Accountability_ABE(group_obj)[source]

Bases: CP_Hiding_ABE

Cipher text policy hiding attribute based encryption (Section 4 in the paper).

decrypt(CT, PK, SK)[source]

Decrypt a cipher text. This algorithm is performed by a data user who has the required attributes to decipher the ciphertext that was encrypted using an access policy. Inputs:

  • CT: Cipher text.

  • PK: Public parameters and the public key of the TA.

  • SK: User’s secret key.

Outputs:
  • m: The original decrypted message.

encrypt(m, PK, access_policy: Dict[str, List[str]])[source]

Encrypt a message using an access policy. This function is performed by a data user who wants to encrypt his message with an access policy. They consider only and-gates in their policy. Note: The access policy is hidden into the ciphertext. Inputs:

  • PK: Public parameters and the public key of the TA.

  • m: Message to be encrypted in G_T.

  • access_policy: Access policy that will be used to encrypt the message. It has to be and gated policy,

    which means that each attribute can have only one value.

Outputs:
  • CT: Cipher text.

key_gen(MSK, PK, ID, attributes_list)[source]

Key generation for a user based on his list of attributes. This algorithm is performed by TA and the user. Part of the key generation is executed as an interaction between the user and the TA, as the user generates a random number (k) that he does not share with the TA. However, he shares with it w**k, and proves knowledge of (k) to TA using any ZKP algorithm. Inputs:

  • MSK: Master Secret Key of the TA.

  • PK: Public parameters and the public key of the TA.

  • ID: User’s unique identifier.

  • attributes_list: List of attributes held by this user, where each attribute is in the format:

    ‘attrName_value’

Outputs:
  • SK: User’s secret key.

key_gen_TA(MSK, PK, ID, R, attributes_list)[source]

Key generation for a user based on his list of attributes. This algorithm is performed by TA and the user. Part of the key generation is executed as an interaction between the user and the TA, as the user generates a random number (k) that he does not share with the TA. However, he shares with it w**k, and proves knowledge of (k) to TA using any ZKP algorithm. Inputs:

  • MSK: Master Secret Key of the TA.

  • PK: Public parameters and the public key of the TA.

  • ID: User’s unique identifier.

  • R: w ** k, where (w) is a public point on the curve, and (k) is the secret KFN selected by the user.

  • attributes_list: List of attributes held by this user, where each attribute is in the format:

    ‘attrName_value’

Outputs:
  • SK: User’s secret key.

setup(attributes_dict: Dict[str, List[str]])[source]

System Setup algorithm. This algorithm is performed by TA. Inputs:

  • None

Outputs:
  • MSK: TA’s master secret key.

  • PK: Public Parameters.

trace(SK_suspected, authentic_user_IDs_list, PK)[source]

Trace function is executed by the auditor. The auditor checks the suspected SK and determines who is misbehaving : the user who owns SK or the TA. If this function is called, it means that either the user or the TA is

misbehaving. The trigger how this function is triggered and how the malicious activity is detected is out of this paper’s scope.

Inputs:
  • SK_suspected: Secret key of the suspected user under the white box model, which means that it has access

    to the full secret key of the user.

  • authentic_user_IDs_list: A list of the authentic user IDs issued by a trusted third party outside the

    system.

  • PK: Public parameters and the public key of the TA.

Outputs:
  • {‘user’: True/False,

    ‘TA’: True/False} ; Only one of them will be true and the other will be false.

abenc_accountability_jyjxgd20.CP_policy_hiding_ABE_test()[source]
abenc_accountability_jyjxgd20.CP_policy_hiding_with_accountability_test()[source]
class abenc_accountability_jyjxgd20.ShnorrInteractiveZKP[source]

Bases: object

Shnorr’s Interactive ZKP

class Prover(secret_x, groupObj)[source]

Bases: object

create_proof(c)[source]
  1. This function is executed by the prover after he received the challenge value (c) from the verifier

create_prover_commitments(pk)[source]
  1. This function is executed by the prover to send a random value to the verifier

class Verifier(groupObj)[source]

Bases: object

create_verifier_challenge()[source]
  1. This function is executed by the verifier after he had received the value u from the prover to send a challenge value to the prover.

is_proof_verified(z, pk, u, h)[source]

4) This function is executed by the verifier to verify the authenticity of the proof sent by the prover z: Created by the prover in create_proof function u: Created by the prover in create_prover_commitments function h: g^x, where x is the secret key of the prover that he wants to prove that he knows it.

abenc_accountability_jyjxgd20.main()[source]