Skip to content

Repository files navigation

DistributedIBE

This library implements the Threshold IBE scheme based on Boneh-Franklin scheme.

Security Parameters

This scheme relies on the hybrid encryption. We use the implementation of such scheme by FiloSottile/age which only encrypts a random symmetric key that is used to encrypt the data using Chacha20Poly1305.

The used symmetric key is of size 32 bytes. The implementation of IBE scheme used to encrypt this key uses the BLS12-381 curve.

Benchmarking Results

We have tested the efficiency of our scheme against the number of validators and message size.

The below table shows the runtime of the scheme covering share generation, key extraction, commitment verification, message encryption, key aggregation, and ciphertext decryption through different numbers of validators:

Number of ValidatorsExecution Time
410880689 ns/op
819333171 ns/op
1636199305 ns/op
3270639750 ns/op
64144968458 ns/op
128290355378 ns/op

Based on the above table, we can clearly see that the executrion time increases linearly with the number of validators.

Since the message is being encrypted first and the key is used for the IBE, we expect the execution time to be independent of the message size. The microbenchmarking results confirm this as shown in the below table:

Message Size (bytes)Execution Time
811180636 ns/op
3211006738 ns/op
12811160579 ns/op
51210927982 ns/op
204810927359 ns/op
819211029081 ns/op

We also broke down the steps to measure the overhead of each stage:

FunctionNumber of ValidatorsExecution Time
Key extraction and aggregation128213753903 ns/op
FunctionNumber of messagesExecution Time
Encryption11574796 ns/op
46179149 ns/op
1624764695 ns/op
64100275889 ns/op
256399253311 ns/op
Decryption87205781 ns/op
3230806709 ns/op
128117187771 ns/op
512457499724 ns/op
1024930084488 ns/op
Message Size (bytes)Encryption Time
81418055 ns/op
321357339 ns/op
1281396858 ns/op
5121385265 ns/op
20481410541 ns/op
81921356855 ns/op
327681406723 ns/op
1310721412484 ns/op
5242881385327 ns/op
10485761369466 ns/op
104857601390764 ns/op
1048576001411491 ns/op
Number of ValidatorsAggregation Time
44.124389 ms/op
88.799101 ms/op
1616.254498 ms/op
3232.488808 ms/op
6463.740821 ms/op
128129.824590 ms/op
256263.148990 ms/op
512548.425002 ms/op
10241206.202045 ms/op
Message Size (bytes)Decryption Time
8689101 ns/op
32687388 ns/op
128728981 ns/op
512723354 ns/op
2048698191 ns/op
8192719345 ns/op
32768716769 ns/op
131072873302 ns/op

In order to improve the efficiency in case of decrypting large number of messages, we can perform the decryption in parallel. Below shows the execution times for the parallel decryption:

FunctionNumber of messagesExecution Time
Decryption82404587 ns/op
326470264 ns/op
12823466097 ns/op
51280075636 ns/op
1024153275583 ns/op

All benchmarks have been ran on a laptop with 12th Gen Intel(R) Core(TM) i7-1270P cpu.

KZG Commitments vs VSS

Below, we compare the verification time for KZG commitments vs VSS.

FunctionNumber of ValidatorsExecution Time
KZG Share Verification44744239 ns/op
89348084 ns/op
1618922709 ns/op
3238153229 ns/op
6477705447 ns/op
128154309057 ns/op
VSS Share Verification4383691 ns/op
81521771 ns/op
167168398 ns/op
3238691278 ns/op
64219296811 ns/op
1281039926768 ns/op
KZG Share Generation4641104 ns/op
82612382 ns/op
1611231675 ns/op
3252606951 ns/op
64260647892 ns/op
1281075045566 ns/op
VSS Share Generation4191175 ns/op
8332393 ns/op
16610982 ns/op
321264965 ns/op
642662454 ns/op
1287105321 ns/op

Configuration

The following commands install the required packages and dependancies:

go mod init DistributedIBE
go mod tidy

Testing

Use the following commands to run the sample test:

cd DistributedIBE
go test

Use the below commands to run the benchmarks:

cd DistributedIBE
go test --bench=.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages