Image encryption using Petri net dynamics with pixel permutation and keystream masking
摘要
Transmission of visual data over untrusted networks and its storage in expansive, shared infrastructures have made image encryption increasingly essential. Emerging applications, including medical imaging, remote sensing, and multimedia content, require ciphers that provide strong statistical security, precise reversibility, and efficient performance on high-resolution images. This work presents a Petri net image encryption technique that combines permutation and substitution within a fixed-size net (256 places and 256 transitions). The net, with its incidence structure and initial marking deterministically derived from a secret key and a public nonce, evolves to generate the pseudorandom sequences required for both encryption stages. Initially, a pixel permutation is synthesized using a Fisher–Yates construction and applied so that all color channels are permuted together, eliminating spatial correlations without modifying pixel intensities. Subsequently, a byte-wise keystream, derived from the net’s state evolution through a short transition trace, long-lag folding, and bit-level whitening, is used to mask the permuted data via XOR, resulting in near-uniform statistical properties. The nonce ensures unique ciphertexts for repeated encryptions with the same key, and decryption precisely reverses both masking and permutation. Comprehensive evaluation of standard color images and medical images reveals ciphertexts with entropy close to 8 bits per byte, pixel-change rates (NPCR) and average intensity change (UACI) that are near theoretical targets, and keystreams that pass the NIST SP 800-22 tests. One-bit key perturbations produce ciphertexts that are statistically unrelated to the baseline, confirming strong key sensitivity. Because the Petri net is of fixed size, sequence generation incurs a constant per-byte cost, and the overall pipeline runs in linear time with linear memory requirements, making the technique practical for large images and straightforward to parallelize.