Project proposal
Project proposal
Name ID No
1- Bikila Tariku
UGR/8089/14
Tables of content
Introduction 2
Project Overview 3
Architecture 3
Flow of Communication 3
User Interaction 3
Diffie-Hellman Key Exchange 4
how the initiator and acceptor exchange keys securely? 4
Initiator / Client 4
Responsibility for Key Exchange: 4
Shared Key Computation: 4
Acceptor / S e r v e r 5
Responsibility for Key Exchange: 5
Shared Key Computation: 5
AES Encryption and Decryption 6
Graphical User Interface (GUI) 9
Message Encryption/Decryption preview 10
Conclusion 15
2
Introduction
The purpose of this project is to implement a secure communication system
using Java, involving a graphical user interface (GUI), socket programming,
and cryptographic techniques. The application comprises initiator and
acceptor that communicate over sockets.
The key objectives include the secure exchange of cryptographic keys
using the Diffie-Hellman key exchange algorithm and the subsequent
encryption and decryption of messages using the Advanced Encryption
Standard (AES) algorithm. The project aims to demonstrate a robust and secure
method of communication, ensuring confidentiality and integrity through
cryptographic protocols.
In this project, Java serves as the primary programming language for developing
the communication system. Java's platform independence, object-oriented
nature, and extensive libraries make it a suitable choice for creating robust
applications.
The project involves the creation of a Graphical User Interface (GUI) to
enhance user interaction and provide a visual representation of the
communication process. The GUI is designed to facilitate the initiation of
communication and showcase the secure exchange of messages.
Socket programming is utilized to establish communication channels
between the peer-1(initiator) and the peer-2(acceptor). Sockets enable
bidirectional data flow between the two entities, allowing for the exchange of
cryptographic keys and encrypted messages. This networking paradigm is
crucial for implementing real-time communication and ensuring a seamless
exchange of information between the server and client components of the
system.
3
Project Overview
Our project focuses on creating a secure communication system using Java,
GUI, and advanced cryptographic techniques. The primary objective is to
establish real-time communication between a peer-1 (initiator) and a peer-2
(acceptor), ensuring the confidentiality and integrity of exchanged information.
Architecture
The architecture comprises a Graphical User Interface (GUI) for user-friendly
interaction, socket communication for bidirectional data flow, and robust error-
handling mechanisms. The Diffie-Hellman key exchange algorithm is integrated
to securely generate shared secret keys, and the Advanced Encryption Standard
(AES) is employed for message encryption and decryption, forming a resilient
foundation for secure communication.
Flow of Communication
The communication flow begins with the initialization of applications, followed
by the secure exchange of partial keys using Diffie-Hellman over sockets. This
establishes a shared secret key for subsequent communication. Messages are
encrypted by the sender using AES and securely transmitted to the receiver,
which decrypts and responds in a similar fashion. The bidirectional
communication ensures a secure and seamless exchange of information.
User Interaction
The GUI facilitates user interactions, allowing users to initiate communication
and monitor encrypted message exchanges. The system provides a responsive
interface, enhancing the overall user experience during the secure
communication process.
4
Initiator / peer-1
Acceptor / peer-2
Exchange:
➔ The acceptor waits for a connection and receives the modulus, base,
and
initiator's public key.
➔ The acceptor generates its public and private keys.
➔ The acceptor sends its public key to the initiator.
5
_modulus=new BigInteger(keyLength,10,cryptographicallySecureRandomNumber);
_selfPrivateKey = new
BigInteger(keyLength-1,cryptographicallySecureRandomNumber);
connection.output.println(message);
send(_modulus, _connection);
send(_base, _connection);
send(clientPublicKey, _connection);
throws Exception {
Integer symmetricKeyLength =
specifiedKeyLength.orElse(_symmetricKeyLength);
? sharedSecretKey.clearBit(sharedSecretKey.bitLength() -
1)
: sharedSecretKey;
paddedKeyBytes[31] = (byte) 0;
keyBytes = paddedKeyBytes;
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] encryptedBytes =
cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
return Base64.getEncoder().encodeToString(encryptedBytes);
decrypt method
protected String decrypt(String encryptedText, BigInteger
sharedSecretKey, Optional<Integer> specifiedKeyLength)
throws Exception {
Integer symmetricKeyLength =
specifiedKeyLength.orElse(_symmetricKeyLength);
? sharedSecretKey.clearBit(sharedSecretKey.bitLength() -
1)
8
: sharedSecretKey;
paddedKeyBytes[31] = (byte) 0;
keyBytes = paddedKeyBytes;
cipher.init(Cipher.DECRYPT_MODE, key);
- This method takes an encrypted message, the shared secret key, and an
optional specified key length as parameters.
- Similar to the encrypt method, it adjusts the shared secret key to the
specified key length and applies padding if necessary.
- The encrypted text is decoded from Base64.
- The AES decryption is performed in ECB mode with PKCS5Padding.
- The decrypted bytes are then converted to a string using UTF-8
encoding and returned.
9
Initiator acceptor
10
Conclusion
In conclusion, the project successfully demonstrated a secure communication
system that ensures the confidentiality and integrity of exchanged information.
By integrating advanced cryptographic techniques, including Diffie-Hellman for
key exchange and AES for encryption/decryption, the project establishes a solid
foundation for secure peer-to-peer communication. The user-friendly GUI
enhances the overall experience, making the system accessible and intuitive.
The implemented security measures prevent unauthorized interception and
ensure the privacy of exchanged messages. The project's successful
implementation aligns with the objectives of providing a secure and efficient
communication solution.