This project ensures secure encryption and decryption of plaintext to secure cyphertext and vice-versa using AES Encryption. And maintains a secure connection between client and server using the RSA algorithm. The project also requires Web Socket programming to generate a local server between the server and the client on the local system.
- The Plaintext and cipher key should be Integer.
- The Public and private key parameters (p and q) should be distinct prime numbers for both server and client.
- For a secure RSA Implementation, p and q should be selected greater than 100.
- WebSocketServer.py should be run before WebSocketClient.py.
This is a 2 round AES Algorithm that encrypts and decrypts the plaintext (integers only). The key needs to be an integer value. AES_Encryption and AES_Decryption are the main classes that take keys when asked for objects to be created. The init() for both calls keyExpansion() that expands the key. The Object then calls the AES_Encrypt function for the client and AES_Decrypt function for the server and then the process carries as it requires to be for encrypting and decrypt function similarly. The encryption goes for two rounds and returns ciphertext for Encryption and plaintext for decryption. All the mid functions prints the data as stated in the standard output file provided.
RSA is a public-key cryptosystem that is widely used for secure data transmission. It is also one of the oldest. The entered parameters p and q will be used to generate the public key (e, n) and private key (d, n) for the server and client using the generate(). The encrypt and decrypt functions are written in such a way that they could handle the encryption and decryption for both the integer value and digest.
- Client inputs: Message, Secret Key, Public and Private key parameters for Client
- Server Inputs: Public and Private key parameters for Server.
-
Message Flow:
- Client requests for public key of server.
- Server sends the public key.
- Client sends Ciphertext, Encrypted secret key, Client Signature, Client public key.
- Create Client signature through RSA algorithm, taking Digest from Hash algorithm and client private key as input.
- Create Ciphertext through the AES variant, taking Message and Secret key as input.
- Encrypt Secret key with RSA algorithm, taking Secret key and Server Public key as input.
Client side computation:
-
Server side Computation:
- Decrypt Secret key using RSA algorithm
- Decrypt ciphertext using AES variant
- Create message digest
- Verify Client Signature