pycastx: A Python library for lightweight data encryption in IoT using ECC and metaheuristics based high-entropy keys and dynamic S-Box

The fast-growing number of Internet of Things (IoT) products in our daily lives is making smart objects more important for us to achieve our goals easily. The Internet of Things (IoT) has a wide range of applications that will have a significant impact on several different industries. Security has become a primary concern as the Internet of Things increases in its vulnerabilities and threats, and the growing demand for secure communication protocols requires robust and efficient cryptographic solutions. We present pycastx, an open-source Python library that simplifies hands-on work in elliptic curve cryptography and dynamic AES S-Box design. pycastx bundles two lean modules, the ECC toolkit and a genetic algorithm S-Box generator, into a single, lightweight package that demands almost no external dependencies. Within the ECC toolkit, users can build curves over prime fields, carry out fast point addition, doubling, and scalar multiplication, generate high-entropy private keys using cryptographically secure random bits, and measure key randomness using Shannon entropy. The S-Box generator employs a flexible genetic algorithm that iteratively generates substitution boxes with peak non-linearity and strong avalanche properties, relying on population initialization, one-point crossover, swap mutations, and damage-repair heuristics. The proposed library and encryption scheme are suitable for IoT applications where efficiency and security are critical. This work narrows the gap between theoretical cryptography and its practical implementation, providing a comprehensive solution for secure data transmission in modern communication systems.

Authors

Institutions

Publication Details

Journal
SoftwareX
Published
2025-08-25
DOI
https://doi.org/10.1016/j.softx.2025.102321
Primary Topic
Cryptographic Implementations and Security
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

pycastx: A Python library for lightweight data encryption in IoT using ECC and metaheuristics based high-entropy keys and dynamic S-Box

Faisal Anwer, Mohammad Khursheed Alam, Md. Asdaque Hussain, Ahwar Khan et al.
SoftwareX
Cryptographic Implementations and Security
article

pycastx: A Python library for lightweight data encryption in IoT using ECC and metaheuristics based high-entropy keys and dynamic S-Box

Faisal Anwer, Mohammad Khursheed Alam, Md. Asdaque Hussain, Ahwar Khan, Salman Ali
article en

Abstract

The fast-growing number of Internet of Things (IoT) products in our daily lives is making smart objects more important for us to achieve our goals easily. The Internet of Things (IoT) has a wide range of applications that will have a significant impact on several different industries. Security has become a primary concern as the Internet of Things increases in its vulnerabilities and threats, and the growing demand for secure communication protocols requires robust and efficient cryptographic solutions. We present pycastx, an open-source Python library that simplifies hands-on work in elliptic curve cryptography and dynamic AES S-Box design. pycastx bundles two lean modules, the ECC toolkit and a genetic algorithm S-Box generator, into a single, lightweight package that demands almost no external dependencies. Within the ECC toolkit, users can build curves over prime fields, carry out fast point addition, doubling, and scalar multiplication, generate high-entropy private keys using cryptographically secure random bits, and measure key randomness using Shannon entropy. The S-Box generator employs a flexible genetic algorithm that iteratively generates substitution boxes with peak non-linearity and strong avalanche properties, relying on population initialization, one-point crossover, swap mutations, and damage-repair heuristics. The proposed library and encryption scheme are suitable for IoT applications where efficiency and security are critical. This work narrows the gap between theoretical cryptography and its practical implementation, providing a comprehensive solution for secure data transmission in modern communication systems.

SoftwareXVol. 31
Aligarh Muslim University (IN), Arab Open University (BH)
Openalex Percentile: Top 88%
Cryptographic Implementations and Security
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.