Performance Analysis of the Cramer–Shoup Cryptographic Algorithm in the Encryption and Decryption Process of Text Files Using Python

Authors

  • Angga Dinata Universitas Nahdlatul Ulama Sumatera Utara Author
  • Demonius Sarumaha, S.Kom, M.Kom Universitas Nahdlatul Ulama Sumatera Utara Author
  • Hery Yusuf Simbolon, S.Pd., M.Si Universitas Nahdlatul Ulama Sumatera Utara Author
  • Muhadi M.Ilyas Gultom, S.Kom, M.Kom Author

Keywords:

Cramer–Shoup, public-key cryptography, encryption, decryption, Python, text file security

Abstract

Data security has become a critical issue in the digital era due to the increasing exchange of sensitive information through electronic media. Cryptography provides an effective solution to ensure the confidentiality and integrity of digital data. This study aims to implement and evaluate the performance of the Cramer–Shoup public-key cryptographic algorithm for encrypting and decrypting text files using Python 3.9.7. The research employed an experimental approach involving key generation, encryption, decryption, and performance testing on plaintext files of different sizes. System performance was evaluated by measuring encryption and decryption execution times while verifying data integrity after the decryption process. The experimental results demonstrate that the proposed implementation successfully generates valid public and private keys and accurately restores the original plaintext without any loss or modification of characters. Performance analysis indicates that execution time increases as the file size grows, with encryption requiring more computational time than decryption due to the generation of random parameters and modular exponentiation during the encryption stage. The highest recorded encryption time for a 15-character text file was 0.054927 seconds, while the corresponding decryption time was only 0.004264 seconds. Despite this difference, the total processing time remained below one second, indicating that the implemented system is computationally efficient for securing small- to medium-sized text files. These findings confirm that the Cramer–Shoup algorithm provides reliable data confidentiality and integrity while maintaining satisfactory execution performance, making it a suitable public-key cryptographic method for text-based data protection.

Downloads

Published

2026-06-28