Cist 140
Cist 140
Abstract - In today’s world the significance of online communication has increased dramatically leading to the need, for strong
encryption. This project focuses on creating a chat application that incorporates end to end encryption to enhance data security. The
encryption technique used combines RSA (Rivest, Shamir, Adleman) for exchange and AES (Advance Encryption Standard) for
message encryption striking a balance between security and performance. A crucial aspect of the development process was ensuring
uninterrupted encrypted chats without any delays. The user interface of the application was designed using Pythons tkinter library
making it user friendly and easy to navigate. Throughout the development phase extensive testing was conducted to identify and
address any vulnerabilities. The encryption employed by the chat application has proven to be highly resilient, against security threats.
We built this application using Python showcases how advanced security measures can be seamlessly integrated into real time chat
platforms while maintaining an interface.
Keywords: Python, Cryptography, Encryption, RSA (Rivest, Shamir, Adleman), Advance Encryption Standard, tkinter
1. Introduction
In today’s age communication methods are evolving at a pace. Instant messaging has become a part of our interaction
thanks to its real time communication and user focused features. Whether it’s through media platforms or professional
collaboration tools, like Slack or Microsoft Teams or traditional text messaging on smartphones these methods have made it
easier for us to connect instantly and effortlessly regardless of distance [1]. Given the landscape, the immediate and pressing
need is for a chat application where user privacy is not an afterthought but a foundational pillar. This project aims to develop
a Secure Chat Application that uses end-to-end encryption as its backbone. Such an application will ensure that only the
sender and the intended recipient can read the content of their conversation, making it resistant to potential eavesdroppers,
be it hackers, corporations, or any other unauthorized entity.
The rise of chat applications not only reflects the need for instant interaction but also emphasizes a pressing concern
for security in these communications. Secure chat applications, such as the one highlighted in this project, prioritize user
privacy by implementing end-to-end encryption. By ensuring that only the communicating users can read the messages, these
platforms aim to reduce vulnerabilities and potential external threats. In this project, we present a robust chat application that
integrates both client and server modules, facilitating secure public and private chat functionalities [2]. By leveraging the
RSA for key exchange and the AES for message encryption, our approach ensures that all communications, whether
broadcast or direct, are secured.
We could have achieved this project's functionality through a console application; however, for simplicity and
enhanced user interaction, we employed the tkinter framework to create a user interface. By doing so, we ensured that
alongside the robust cryptographic functions, we are presented with an interface that is both familiar and user-friendly. This
design choice aligns with best practices in secure software design and strikes a balance between usability and security. The
chat program emphasizes data persistence by allowing encrypted chat histories to be saved and retrieved, offering users both
convenience and an additional layer of security [3].
CIST 140-1
Fig. 1: End to End Encryption
Fig. 1, shows a schematic of an encrypted communication system involving a server and two users, A and B. The
server distributes public keys to both users [4]. User A sends an encrypted message to the server, which then decrypts it, but
only if both the public and corresponding private keys are available. The decrypted message is then securely transmitted to
User B. The process ensures that messages can only be read by the intended recipient.
We strived to preserve message integrity and user confidentiality by employing both RSA and AES encryption
techniques. This commitment to security represents a crucial step in our design approach. By integrating these encryption
methods, we provided dual layers of protection. RSA is for safeguarding during the key exchange and AES for ensuring the
actual message encryption [5]. Through this dual approach, we effectively strengthened our application against a number of
cyber threats, including man-in-the-middle attacks, and eavesdropping, data tampering [6].
The rest of the paper is organized as follows: Section I provided the motivation and background of the work. Section
II and III present Literature review and Methodologies respectively. Our Application Testing, Discussions, Results and
Future Scope are presented in Section IV and V. Finally, we concluded in section VI.
2. Literature Review
A number of researches have been carried out on the security mechanisms supporting digital communication
platforms. The rising cases of cyber threats have drawn significant attention to the essentials of ensuring user privacy and
data integrity in this digital age. Several scholars and industry professionals have highlighted the critical importance of end-
to-end encryption in chat applications. While the concept of end-to-end encryption is not groundbreaking in itself, its detailed
application and criticality in ensuring a secure channel for communication have been extensively discussed in the literature.
In the context of secure messaging, Randall (1997) highlighted the transition from traditional communication methods
to digital platforms, underscoring the increasing need for enhanced security measures in chat applications. Their findings
suggest that with the increase of cyber threats, there is an crucial need for applications to guarantee user data and
confidentiality, thus advocating for advanced encryption methodologies like RSA and AES [7].
Building on this, Sabah et al. (2005) focused on the technical insights of implementing RSA in chat applications. They
noted that while RSA is computationally intensive, its unparalleled security benefits in key exchanges, especially in chat
applications, make it a worthwhile investment for developers. The combination of RSA for key exchanges and AES for
actual message encryption provides a robust two-layered security system that can defeat most cyber-attacks [8].
Yet, the sector of encrypted chat applications is not without its challenges. Hughes (2007) identified potential
vulnerabilities even in encrypted platforms, especially if the encryption keys are compromised. Their research underscores
the importance of continually updating and refining encryption algorithms to stay ahead of potential threats [9]. This
observation resonates with our project's approach, emphasizing the proactive enhancement of security measures.
From a user experience perspective, in their study, U. Tariq et al. (2023) argued that security should not come at the
cost of usability. Applications must ensure an intuitive interface, even when employing complex encryption techniques in
the background [10]. The use of platforms like tkinter, as noted in our project, aligns with this principle, offering users an
accessible interface while maintaining tight security protocols.
While the sector of secure chat applications continues to evolve, the consensus in the literature underscores the critical
importance of end-to-end encryption. Balancing advanced security measures with user-friendliness remains a pivotal
challenge, but with advancements like the ones highlighted in our project, the future of secure digital communication appears
promising.
CIST 140-2
3. Methodologies
CIST 140-3
The deployment of AES was carefully done to operate in Cipher Block Chaining (CBC) mode, which ensured that
patterns were not discernible in ciphertext. This mode was selected for its feedback mechanism, which provided an additional
layer of security. The AES keys, once exchanged, were handled with strict confidentiality protocols, ensuring they remained
uncompromised throughout their lifecycle.
4. Steps
CIST 140-4
Type a message in the "You" window and click on "Send". The message will appear in the "Partner" window.
Fig. 2: The unsecure chat Fig. 3: Unencrypted data from the Unsecure chat captured in
Wireshark
CIST 140-5
Fig. 3, displays a Wireshark packet analysis, capturing network traffic from the chat application shown in Fig. 2. It reveals
the content of the messages sent over the network unencrypted, as evidenced by the readable excerpt from the data packet.
As anticipated, in the absence of encryption, Wireshark easily captured and displayed the chat messages in plain text. This
observation highlighted the vulnerabilities of an unencrypted communication system and underscored the significance of
implementing robust encryption mechanisms.
Fig. 4: Sending messages through an encrypted chat. Fig. 5: The data captured by Wireshark is encrypted
Fig. 5, represents a snapshot of Wireshark captures network traffic from the secure chat application, displaying an obscured
view of the data, indicative of successful encryption. The hex values suggest the data is no longer in plain text, verifying
the effectiveness of the implemented end-to-end encryption.
When the end-to-end encryption was activated, Wireshark could no longer decipher the actual contents of the chat
messages. Instead of plain text messages, Wireshark now captured encrypted data packets, showcasing the efficiency of
our encryption methodologies.
CIST 140-6
Fig. 6, shows an image displaying the contents of a 'chat_history.txt' file opened in a Notepad application. The text shown
consists of a long string of encrypted data, with no discernible words or phrases, only a series of alphanumeric characters
and symbols that reflect the application of a secure encryption algorithm to the chat history. This ensures that without the
corresponding decryption key, the information is unreadable, safeguarding user conversations against unauthorized access.
When we accessed the chat_history.txt file, the messages were encrypted, ensuring an added layer of security. Even if
unauthorized users accessed this file, the content remains unintelligible without the proper decryption key.
During testing, as shown in Fig. 7, this feature has proved beneficial, especially in scenarios where specific devices had
restrictions preventing them from acting as servers. The ability to switch roles ensured uninterrupted communication.
In Fig. 8, the application demonstrated resilience, effectively handling most errors. It provided relevant feedback to users,
such as "Partner has disconnected" or "Error receiving message. Exiting…", ensuring they were always informed about the
chat's status.
CIST 140-7
6. Conclusion
The constant evolution of the digital sector underscores the urgency to prioritize data security, especially in real-time
communication platforms. With the development of our project’s application, we aimed to strike a balance between
ensuring robust security and encrypting the user history messages. The combination of RSA for key exchanges and AES
for message encryption has distinctly strengthened the security layer of our chat mechanism. However, as is the case with
most technological projects, there is always an avenue for growth and enhancement. At present, our focus has been majorly
centralized around text-based communication. Drawing inspiration from the transformation of modern chat platforms,
which began as text-only platforms but eventually upgraded into multimedia communication hubs, we acknowledge the
potential for further advancements in our application.
References
[1] Chatterjee, N., Chakraborty, S., Decosta, A., & Nath, A. (2018). Real-time Communication Application Based on
Android Using Google Firebase. International Journal of Advance Research in Computer Science and
Management Studies, 6(4). [Online] Available: www.ijarcsms.com.
[2] Sowah, R. A., Ofoli, A. R., Krakani, S. N., & Fiawoo, S. Y. (2017). Hardware design and web-based
communication modules of a real-time multisensor fire detection and notification system using fuzzy logic. IEEE
Transactions on Industrial Applications, 53(1), 559-566. https://doi.org/10.1109/TIA.2016.2613075.
[3] Anglano, C., Canonico, M., & Guazzone, M. (2016). Forensic analysis of the ChatSecure instant messaging
application on android smartphones. Digital Investigation, 19, 44-59. https://doi.org/10.1016/j.diin.2016.10.001.
[4] Hegde, S., & Shah, S. (2015). A SURVEY ON THE LATEST WEB TECHNOLOGIES. [Online] Available:
www.ijtra.com.
[5] G. Rovira Sánchez, "Implementation of a chat application for developers," 2017.
[6] A. Kumar and A. Singh, "Research paper on Group chatting Application." [Online]. Available:
https://www.researchgate.net/publication/360483603. Accessed: 2023.
[7] Randall, N. (1997). Epilogue: The Soul of the Internet. In The soul of internet: net gods, netizens, and the wiring of
the world (pp. 345-358). London: Computer Press.
[8] N. Sabah, J. M. Kadhim, and B. N. Dhannoon, "Developing an End-to-End Secure Chat Application," Nov. 2017.
[Online]. Available: https://www.researchgate.net/publication/322509087_Developing_an_End-to-
End_Secure_Chat_Application.
[9] J. Hughes, "LONG-TERM SECURITY VULNERABILITIES OF ENCRYPTED DATA," 2007.
[10] U. Tariq, I. Ahmed, A. K. Bashir, and K. Shaukat, "A Critical Cybersecurity Analysis and Future Research
Directions for the Internet of Things: A Comprehensive Review," Sensors, vol. 23, no. 8, p. 4117, 2023. [Online].
Available: https://doi.org/10.3390/s23084117.
CIST 140-8