Get started with the basics of cryptography in Python.
I'm assuming that the basics of crytography are already clear to you.
If not, click here
Read more here - PublicKey Crpytography, Symmetric Cryptography, SHA256
The code deals with three types of problems.
- Symmetric key cryptography i.e. One key for both sender and reciever.
- Public Key cryptography i.e Two keys (Public key for encryption and Private Key for decryption).
- Public Key cryptograhy with SHA256 i.e. (Same as previous one but hashing helps in checking the authenticity of the file transferred).
The programs aim to transfer a file from sender to reciever via socket programming in an encrypted fashion. The sender sends a sample.txt in chunks of 1024 bytes (every chunk is encrypted before sending). The reciever then recieves these chunks, decryptes them and save them to a file. Hence the file is transferred (Securely).
- Python2.7
- Pycrypto library. Run the following command to get Pycrypto in CMD : "C:\python27\Scripts\easy_install pycrypto"
- First things first, we need keys. Irrespective what program you wish to execute, run KeyGen.py first. This shall create key(s) in the keys folder.
python KeyGen.py
- Secondly, run sendn.py, this shall wait for a reciever before sending out a file to reciever.
python sendn.py
- Lastly, run recn.py, this shall connect to a sender and starts to recieve file.
python recn.py
Made by Akash Govind under MIT License ©