Digital Signature Creator is a Python-based project that generates public and private keys, and creates digital signatures for a given message using RSA cryptography. This project is designed to demonstrate the fundamental principles of digital signatures and public key cryptography.
- RSA Key Generation: Generates a pair of RSA keys (public and private) with 512-bit prime numbers.
- Digital Signature Creation: Signs a user-provided message using the RSA private key and SHA-256 hashing algorithm.
- Base64 Encoding: Encodes the generated digital signature in Base64 format for easy readability and transmission.
- Key Export: Exports the public and private keys in PEM format.
-
Clone the Repository:
git clone https://github.com/zorohack03/AuthentiKey.git cd AuthentiKey -
Install Dependencies: Ensure you have
pycryptodomeinstalled:pip install pycryptodome
-
Run the Script:
python digital_signature_creator.py
-
Enter Your Message: When prompted, enter the message you want to sign.
- Prime Number Generation: Generates two large prime numbers (512 bits each).
- Compute
nandφ(n): Computes the modulusnand the totientφ(n). - Public Exponent Selection: Chooses a public exponent
ethat is coprime withφ(n). - Private Exponent Calculation: Calculates the private exponent
dusing the modular inverse ofe. - RSA Key Construction: Constructs the RSA public and private keys using the calculated values.
- Message Hashing: Hashes the input message using SHA-256.
- Digital Signature: Signs the hashed message with the RSA private key.
- Base64 Encoding: Encodes the digital signature in Base64 format.
- Key Export: Exports the RSA public and private keys in PEM format.