CipherX is a hybrid encryption-decryption framework that combines the strength of AES, DES, and RSA algorithms to ensure secure data encryption, transmission, and decryption between a client and server.
-
Hybrid Encryption:
- AES (Advanced Encryption Standard) for secure and fast symmetric encryption.
- DES (Data Encryption Standard) as an additional layer of symmetric encryption.
- RSA (Rivest–Shamir–Adleman) for public-key encryption of the AES and DES keys.
-
End-to-End Workflow:
- Encrypts plaintext using AES and DES at the client-side.
- Encrypts AES and DES keys using RSA before transmission.
- Decrypts data and keys step-by-step on the server-side to retrieve the original plaintext.
-
Socket Communication:
- Uses Java sockets for client-server communication.
-
Security and Key Management:
- Key generation for AES, DES, and RSA is handled programmatically.
- RSA private key transmitted in Base64 format for demonstration purposes (not recommended in real-world applications).
- Overview
- Technologies Used
- Encryption Workflow
- Decryption Workflow
- Setup and Execution
- Code Files
- Security Considerations
CipherX demonstrates a secure communication framework where a hybrid encryption-decryption model ensures the confidentiality of sensitive data. The framework includes:
- A server that decrypts data using RSA, DES, and AES.
- A client that encrypts plaintext and sends encrypted data and keys to the server.
- Programming Language: Java
- Encryption Algorithms: AES, DES, RSA
- Network Protocol: TCP Sockets
-
Key Generation:
- AES key (128-bit) is generated for encrypting the plaintext.
- DES key (56-bit) is generated for encrypting the AES-encrypted text.
- RSA key pair (2048-bit) is generated for encrypting the AES and DES keys.
-
Encryption Steps:
- Plaintext is encrypted with the AES key.
- AES-encrypted text is further encrypted with the DES key.
- AES and DES keys are encrypted using the RSA public key.
-
Transmission:
- Encrypted data, encrypted keys, and the Base64-encoded RSA private key are sent to the server.
-
Key Decryption:
- The AES and DES keys are decrypted using the RSA private key.
-
Data Decryption:
- The data encrypted with DES is decrypted using the DES key to retrieve the AES-encrypted text.
- The AES-encrypted text is decrypted using the AES key to retrieve the original plaintext.
-
Output:
- The decrypted plaintext is displayed on the server console.
- Java Development Kit (JDK) installed on your system.
- Basic knowledge of encryption algorithms and Java sockets.
-
Clone the repository:
git clone https://github.com/rushikesh5035/CipherX.git cd cipherx-hybrid-encryption -
Compile the Java files:
javac DecryptionServer.java EncryptionClient.java
-
Run the server:
java DecryptionServer
-
Run the client:
java EncryptionClient
-
Enter the plaintext when prompted on the client.
-
View the decrypted message on the server console.
This file contains the client-side implementation for encrypting the plaintext and transmitting the encrypted data and keys to the server.
- Generates AES, DES, and RSA keys programmatically.
- Encrypts plaintext using AES and DES.
- Encrypts AES and DES keys using RSA.
This file contains the server-side implementation for decrypting the received data and keys.
- Listens on port 12345 for client connections.
- Decrypts AES and DES keys using RSA.
- Decrypts data sequentially using DES and AES.
-
Private Key Transmission:
- The private RSA key is transmitted to the server for demonstration purposes. In real-world scenarios, consider using secure key exchange protocols such as Diffie-Hellman.
-
Algorithm Choice:
- Replace DES with AES or other stronger symmetric encryption algorithms.
-
Data Integrity:
- Implement HMAC or digital signatures to ensure data authenticity and integrity.
-
Secure Communication:
- Use SSL/TLS for encrypting socket communication.