Skip to content

Files

Latest commit

49b1112 · Nov 13, 2024

History

History

1_ecc-threshold-decryption

ECC_threshold_decryption

This is an implementation of a proof-of-concept (POC) of the ideas proposed by ZHANG Xian-feng, ZHANG Feng, QIN Zhi-guang, LIU Jin-de in their paper ECC Based Threshold Decryption Scheme and Its Application in Web Security (2004).

In this paper Zhang, Zhang and Qin proposed a Threshold Decryption scheme based on ( t , n ) secret sharing:

Overview

In this scheme, let:

  • P > 3 be a prime number
  • E ( A , B ) be an Elliptic Curve group over G F ( P ) .
  • H be a cyclic subgroup of E ( A , B ) such that the discrete logarithm problem is intractable over H .
  • g be a generator for H .

and:

  • A be the sender,

  • B be the receiver, who does not keep his private key d locally. Instead, d is stored across t out of n share servers, represented as:

    d = d 1 + d 2 + . . . + d t

The corresponding share servers are denoted as ( C 1 , C 2 , . . . , C t ) . The encryption and decryption process follows these steps:

Encryption Process

  1. Select a random integer ( k < | H | ) .
  2. Compute:
    • y = ( k g ) mod P
    • ( c 1 , c 2 ) = ( k h ) mod P
    • s 1 = ( c 1 x 1 ) mod P
    • s 2 = ( c 2 x 2 ) mod P

The encrypted form of ( X ) is ( y , s 1 , s 2 ) .

Normal decryption Process

To decrypt the ciphertext:

  1. From the first coordinate ( y ) of the encryption triplet, the holder of the private key ( d ) computes:

    d y = ( c 1 , c 2 ) mod P

  2. Compute the plaintext values:

    • x 1 = ( s 1 c 1 ) mod P
    • x 2 = ( s 2 c 1 ) mod P

The decrypted form of ( y , s 1 , s 2 ) yields ( x 1 , x 2 ) .

Threshold Decryption process

B broadcasts ( y ) in the encryption triplet ( y , s 1 , s 2 ) to C 1 , C 2 , , C t :

  1. Each server C i computes:

    Q i = ( d i y ) mod P

  2. After obtaining all ( Q i ) , B computes:

    Q = ( 1 t j = 1 t Q j ) mod P

  3. Finally, B computes:

    • B 1 = ( s 1 Q 1 ) mod P
    • B 2 = ( s 2 Q 1 ) mod P

Thus, the decrypted values are ( b 1 , b 2 ) .

Proof of Correctness

The proof shows that:

Q = ( j = 1 t Q j mod P ) = 1 t j = 1 t d y mod P

This leads to the conclusion:

( b 1 , b 2 ) = ( x 1 , x 2 ) mod P

Usage

Installation

Clone the repository:

git clone https://github.com/yourusername/ECC-Based-Threshold-Decryption.git
cd ECC-Based-Threshold-Decryption

Running the code

To run the implementation, execute:

cargo run

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Thanks to the original authors and researchers: ZHANG Xian-feng, ZHANG Feng, QIN Zhi-guang, LIU Jin-de who contributed to the field of threshold decryption and ECC.