Skip to content

filipwroblewski/rsa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

RSA

Video presentation

YouTube video

Goal

The aim of the project is to implement the RSA cryptographic algorithm. Additionally, the implementation of the process of loading and using text data, as well as the process of saving this data to a file, or displaying this data. The program also has the implementation of the function of saving data to a file, or their execution.

Used tools

Basic structure

./main.py
./keys
./execute_commands.py

For the program to run properly, the keys folder is needed in the same location as main.py

Usage

Display help

python main.py -h
λ python main.py -h
usage: main.py [-h] [-text TEXT] [-loadText LOADTEXT] [-encryptedFile ENCRYPTEDFILE]
               [-save SAVE] [-encryption] [-decryption] [-genKeys] [-showEncryptedText]

RSA encryption consists in generating a pair of keys (private key, public key). The
message is then encrypted with the public key. Finally, the process of decrypting the
message using the private key is carried out.

options:
-h, --help            show this help message and exit
-text TEXT            Enter text
-loadText LOADTEXT    Read text from a file
-encryptedFile ENCRYPTEDFILE
                      A file with encrypted data
-save SAVE            Use to save the decrypted text to a file
-encryption           Use for encryption
-decryption           Use to decrypt
-genKeys              Use to generate a new key pair
-showEncryptedText    Use to display ciphertext

__________

Example usage

python main.py -encryption -genKeys -text "przykładowy tekst"
python main.py -decryption

python main.py -encryption -text "Ciekawostki nr 1"
python main.py -decryption

python main.py -encryption -text "Ciekawostki nr 2" -encryptedFile a.txt
python main.py -decryption -encryptedFile a.txt

python main.py -encryption -genKeys -loadText tekst.txt
python main.py -decryption

python main.py -encryption -loadText tekst.txt
python main.py -decryption

Automated test of functionality

python execute_commands.py

About

🔓 RSA encription and decription

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages