Skip to content

This repository contains a Python script that implements a digital signature system and provides functionality for verify the signature. The script uses RSA-like generate and verify methods, along with simple mathematical algorithms for efficient computation.

Notifications You must be signed in to change notification settings

sacaaa/digital-signature-based-rsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

digital-signature-based-rsa

This repository contains a Python script that implements a digital signature system and provides functionality for verify the signature. The script uses RSA-like generate and verify methods, along with simple mathematical algorithms for efficient computation.

Features

  • Key generation
  • Signature generation
  • Signature verification
  • Message decryption from signature

Requirements

  • Python 3.6 or higher

Signature generate

You can run the signature_generator.py script from the command line with the following command:

python signature_generator.py <bit_size> "<message>"

Replace <bit_size> with the desired bit size for key generation and with the message you want to sign.

For example:

python signature_generator.py 512 "Hello, World!"

Signature verify

You can run the signature_verifier.py script from the command line with the following command:

python signature_verifier.py <signature> <public_key> <modulus>

Replace , <public_key>, and with the signature to verify, the public key used for verification, and the modulus used for verification, respectively.

For example:

python signature_verifier.py 855924288 683203879 1548022963

Important

The larger the number of bits you specify when calling the program from the command line, the longer the program takes to calculate!

If the length of the message to be generated exceeds the length of the modulus, then the RSA algorithm will not properly generate the message, and you will encounter a ValueError. In this case, increase the bit size of the prime numbers when calling the program from the command line.

About

This repository contains a Python script that implements a digital signature system and provides functionality for verify the signature. The script uses RSA-like generate and verify methods, along with simple mathematical algorithms for efficient computation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages