Skip to content

SankalpMe/Cryptshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cryptshare

Prerequisite Knowledge: RSA (Rivest–Shamir–Adleman) is an algorithm used by modern computers to encrypt and decrypt messages. It is an asymmetric cryptographic algorithm.

About:

It is a small simple project that implements the RSA encryption algorithm , to encrypt / decrypt small messages using generated private keys, hence allowing encrypted communication between people.

Working:

The working of the project can be broken into loosely coupled procedures:

  1. Generate RSA Key from user salt.

  2. Save both public / private key to file.

  3. Now the program does two function:

    1. Encrypt Message to Disk.
    2. Decrypt Encrypted Message on Disk.
  4. Procedure for Encrypting Message to Disk:

    1. perform input of message from user.
    2. use “RSABlock” encryption algorithm to encrypt message.
    3. Save encrypted message to disk.
  5. Procedure for Decrypting Encrypted Message on Disk:

    1. read encrypted message from disk.
    2. use “RSABlock” decryption algorithm to decrypt the encrypted message.
    3. display the decrypted message to user.
  6. The decrypting operation only works if a private key is loaded.

  7. The encrypting operation works on both keys.

Working of RSA Key Generation:

This is the part of program handled by ( class : RSAGenerator ), this part is responsible for creation of public and private keys that are needed for algorithm. Procedure:

  1. take salt input from user.
  2. generate two coprime numbers.
  3. feed these numbers to RSA_KEY_GENERATION algorithm.
  4. generated ( class : RSAGenerator ) object is feed to ( class : RSAKey ) object.
  5. once keys are generated the keygen object is no longer needed as the keys exist on their own.

Working of RSABlock Encryption:

This is the part of program handled by ( class : RSABlockKey ), this part is responsible for encrypting large chunks of data, which is not support by vanilla RSA Algorithm. Procedure:

  1. the algorithm converts any object/string/datatype into an char array ( char ptr pointing to mloc of the object/datatype ).
  2. the algorithm runs sequentially on each item of the array ( char ptr ),and encrypts/decrypts them by RSA algorithm.
  3. the encrypted/decrypted message can be stored or read from disk using custom methods provided in the class.
  4. The blockkey requires RSAKey to perform encryption/decryption.

Flow Chart

Header Files

The overall program has used the following header files:

  1. iostream.h
  2. fstream.h
  3. math.h
  4. thread.h
  5. chrono.h

The program internally contains two header files:

  • RSA.h: Responsible for implementing RSA,RSABlock Algorithm.
  • Loader.h Responsible for generating custom loading screen.

Files Generated By Program

The program generated two category of file of which each is an binary file. Key Files: These files are responsible for storing the generated public and private key:

  1. <key-name>.key.dat : This file stores the private key. denotes name of key.Ex. Private key pbm is stored as : “pbm.key.dat”.
  2. <key-name>.public.key.dat : This file stores the public key. denotes name of key. Ex. Public key sbm is stored as : “sbm.public.key.dat”.

Message Files: <msg-name>.msg.dat : this stores the encrypted form of message in binary format. <msg-name> denotes name of message. Ex. Message cipho is stored as “cipho.msg.data”

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published