UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
University of West Attica · Department of Computer Engineering and Informatics
Information Technology Security
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervision
Supervisor: Ioanna Kantzavelou, Associate Professor
Co-supervisor: Angelos Georgoulas, Assistant Professor
Athens, May 2023
This project explores fundamental cryptographic operations using the OpenSSL BIGNUM (BN) library. It focuses on the practical implementation of RSA cryptography, including key generation, encryption, decryption, digital signatures, and certificate verification.
All implementations are written in C and utilize the OpenSSL BN library to handle large integer arithmetic beyond standard machine limits.
| Section | Path / File | Description |
|---|---|---|
| 1 | assign/ |
Official laboratory exercise specifications |
| 1.1 | assign/Exercise 2 (Cryptography)_2023.pdf |
Assignment description (English) |
| 1.2 | assign/Ασκηση 2 (Cryptography)_2023.pdf |
Assignment description (Greek) |
| 2 | docs/ |
Project reports and theoretical analysis |
| 2.1 | docs/Cryptography.pdf |
Technical report (English) |
| 2.2 | docs/Κρυπτογραφία.pdf |
Technical report (Greek) |
| 3 | src/ |
Cryptographic implementations and verification tools |
| 3.1 | src/private_key.c |
RSA private key generation |
| 3.2 | src/public_key |
RSA public key extraction |
| 3.3 | src/crypto_msg.c |
Message encryption using public key |
| 3.4 | src/decrypto_msg.c |
Message decryption using private key |
| 3.5 | src/sign_msg.c |
Digital signature generation |
| 3.6 | src/verify_sign.c |
Digital signature verification |
| 3.7 | src/verify_sign_cert.c |
Signature verification using X.509 certificates |
| 3.8 | src/bn_sample.c |
Big number (BN) operations example |
| 3.9 | src/c0.pem, src/c1.pem |
RSA certificates |
| 3.10 | src/c0_body.bin |
Binary certificate body |
| 3.11 | src/cert_info.txt |
Certificate metadata and inspection output |
| 4 | screens/ |
Experimental evidence and execution results |
| 4.1 | screens/Activity1–6/ |
Step-by-step screenshots for each cryptographic activity |
| 5 | README.md |
Project documentation |
| 6 | INSTALL.md |
Usage instructions |
The laboratory work is divided into independent activities, each targeting a specific cryptographic concept:
-
Private Key Generation (
private_key.c)
Calculates the RSA private keydusing prime numbersp,q, and the public exponente. -
Message Encryption (
crypto_msg.c)
Encrypts a plaintext message (e.g., a student's name) using the RSA encryption formula:$$ C = M^e \pmod{N} $$ -
Message Decryption (
decrypto_msg.c)
Decrypts an encrypted hexadecimal ciphertext back into readable text using:$$ D = C^d \pmod{N} $$
-
Digital Signature Creation (
sign_msg.c)
Generates a digital signature for a given message using the RSA private key. -
Signature Verification (
verify_sign_msg.c)
Verifies message authenticity by comparing the decrypted signature with the original message. -
X.509 Certificate Verification (
verify_sign_cert.c)
Manually extracts and verifies the digital signature of a real-world web server certificate
(e.g., apachefriends.org).
- Modulo (RSA modulus):
- Euler’s Totient Function:
- Private Key Calculation:
- Encryption:
- Decryption:
Even a single-bit change in a message or signature produces a completely different result, ensuring data integrity.
The OpenSSL BN library efficiently manages large integers required for secure RSA operations.
The same RSA principles implemented in this lab are used in X.509 certificate verification for secure web communications.
This laboratory project demonstrates how theoretical cryptographic principles are applied in practice using professional-grade libraries. It bridges the gap between academic RSA concepts and their real-world security applications, such as encrypted communication and digital certificate validation.
