The article is devoted to the problem of common secret key agreement in a group of an arbitrary number of participants. Data is exchanged between participants through open data channels. The problem of sharing a secret key over open data channels arose due to the need for a secure exchange of information between two or more parties that may be remote from each other and do not have a common confidential communication channel. Reliable methods of secret key exchange, such as transferring the key in person or using a secure channel, are not practical in remote or scalable scenarios. In the process of developing and modelling cryptographic systems, in which there is a need of cryptographic keys agreement in a group of two or more participants, it is very convenient to have a model that implements these algorithms. The agreement protocol is based on the Diffie-Hellman protocol on elliptic curves (ECDH). The paper contains theoretical justifications, a flow chart of the algorithm, and a Python implementation of the algorithm that performs the secret key agreement in a group of an arbitrary number of participants. To implement cryptographic operations on elliptic curves, the Python library Cryptography is used, in particular, the X25519 algorithms that use the elliptic curve Curve25519. The results of the work are shown on an example for a group of four participants, which demonstrate the correct operation of the model and the same secret key obtained as a result of agreement process. The paper also contains the link to a GitHub repository with the full program. The multi_participant_ecdh.py file contains a secret key agreement program for N participants written in Python. The file two_participant_ecdh.py demonstrates a typical two-participant Diffie-Hellman protocol. Both programs use the X25519 algorithm implemented in the Cryptography Python library. Thus, this work makes it possible to better understand the principles of secret key exchange algorithms between two and an arbitrary number of participants, to compare the results with other implementations, to apply the developed model for educational and demonstration purposes, and may be useful for a number of other scientific and engineering tasks.
Read full abstract