Python-модель протоколу узгодження секретного ключа у групі з довільної кількості учасників
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Видавництво Львівської політехніки
Lviv Politechnic Publishing House
Lviv Politechnic Publishing House
Abstract
Стаття присвячена проблемі узгодження спільного секретного ключа у групі з довільної кількості учасників. Обмін даними між учасниками здійснюється через відкриті канали передачі даних. Проблема обміну секретним ключем через відкриті канали даних виникла через потребу в безпечному обміні інформацією між двома або більше сторонами, які можуть бути віддаленими одна від одної та не мають спільного конфіденційного каналу зв'язку. Надійні методи обміну секретним ключем, такі як передача ключа особисто або використання захищеного каналу, не є практичними у віддалених або масштабованих сценаріях. В процесі розроблення та моделювання криптографічних систем, в яких є необхідність здійснювати узгодження криптографічних ключів в групі з двох та більше учасників, дуже зручно мати модель, яка реалізує ці алгоритми. В основі протоколу узгодження лежить протокол Діффі-Геллмана на еліптичних кривих (ECDH). Робота містить теоретичні обґрунтування, блок-схему алгоритму та програмну реалізацію алгоритму (на Python), який здійснює узгодження секретного ключа у групі з довільної кількості учасників. Для реалізації криптографічних операції на еліптичних кривих застосовано Python-бібліотеку Cryptography, зокрема алгоритми X25519, що використовують еліптичну криву Curve25519. Показано результати роботи на прикладі групи з чотирьох учасників, які демонструють коректну роботу моделі та однаковий секретний ключ, отриманий в результаті процесу узгодження. Робота також містить посилання на репозиторій GitHub з повним текстом програми. Файл multi_participant_ecdh.py містить програму узгодження секретного ключа для N учасників, написану мовою Python. Файл two_participant_ecdh.py демонструє типовий протокол Діффі-Геллмана для двох учасників. Обидві програми використовують алгоритм X25519, реалізований в Python-бібліотеці Cryptography. Таким чином, дана робота дає змогу краще зрозуміти принципи роботи алгоритмів обміну секретними ключами між двома та довільною кількістю учасників, здійснити порівняння результатів з іншими реалізаціями, застосувати розроблену модель в навчальних та в демонстраційних цілях і може бути корисною для ряду інших наукових та інженерних задач.
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.
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.
Description
Citation
Маньковський С. Python-модель протоколу узгодження секретного ключа у групі з довільної кількості учасників / С. Маньковський, Ю. Матієшин // Інфокомунікаційні технології та електронна інженерія. — Львів : Видавництво Львівської політехніки, 2024. — Том 4. — № 1. — С. 93–101.