Data Com Lab Project Report Partho 221002604
Data Com Lab Project Report Partho 221002604
Student Details
Name ID
[For Teachers use only: Don’t Write Anything inside this box]
3. OBJECTIVES/AIMS
In an era where data breaches and cyber threats are increasingly prevalent, ensuring the security
and privacy of information is paramount. This project aims to develop a comprehensive encryption
and decryption system using advanced cipher techniques.
• Develop an encryption module that can securely convert plaintext into ciphertext using
various cipher techniques.
• Create a decryption module that can accurately revert ciphertext back to plaintext for
authorized users.
• Implement multiple cipher algorithms including ceasar cipher, substitution cipher and XOR
cipher encryption.
• Ensure data integrity and authenticity through the implementation of cryptographic hash
functions.
Encryption: Each bit of the message (often represented in ASCII code for text) is
XORed with the corresponding bit from the key. This essentially flips the bits
wherever the corresponding bits in the message and key differ.
Decryption: To decrypt the message, you simply XOR the ciphertext (encrypted
message) with the same key again. Because XOR is its own inverse (meaning XORing
twice with the same key cancels out the effect), this reverses the encryption and
retrieves the original message.
6. SOURCE CODE
7. TEST RESULT
Initial Output
8. DISCUSSION
1. Code Discussion
Main Function: The main function provides a user interface to choose between
encrypting or decrypting text, and to select the algorithm for the operation.
Encryption and Decryption Functions: The code has two main functions, ‘encryptText’
and ‘decryptText’ which handle the overall process of encryption and decryption
respectively. ‘encryptText’ Encrypts the input text using the chosen algorithm.
‘decryptText’ Decrypts the input text using the chosen algorithm.
Cipher Algorithms: ‘caesarEncrypt’ Encrypts text by shifting each letter by a specified
number of positions. ‘caesarDecrypt’ Decrypts text by shifting each letter back by the
same number of positions used in encryption. ‘substitutionEncrypt’ Encrypts text by
substituting each letter with a corresponding letter from a provided key.
‘substitutionDecrypt’ Decrypts text by reversing the substitution process.
File Operations: ‘encrypted_text_output.txt’ Stores the result of the encryption.
‘decrypted_text_output.txt’ Stores the result of the decryption.
2. Result Discussion
The code simulates a text cipher program. The program greets the user with an intro
message, including a title and thematic text. It presents a menu with choices for encryption,
decryption, or exit. For encryption and decryption, it asks the user for: Text to
encrypt/decrypt Encryption/decryption algorithm (Caesar Cipher, Substitution Cipher,
XOR Cipher) Additional parameters based on the chosen algorithm (e.g., shift value for
Caesar Cipher, key for Substitution/XOR). It validates user input and provides error
messages if invalid options are chosen. Based on user choices, the program performs the
following:
Encryption: Applies the chosen algorithm (Caesar Cipher, Substitution Cipher, XOR
Cipher) to the input text and saves the encrypted output to a file named
‘encrypted_text_output.txt’.
Decryption: Applies the chosen algorithm (Caesar Cipher, Substitution Cipher, XOR
Cipher) to the input text and saves the decrypted output to a file named
‘decrypted_text_output.txt’.
For Error Handling, the program validates user input for choices and key formats. It
displays error messages if invalid input is detected and might exit the program in critical
cases (e.g., invalid substitution key). It handles potential file opening errors during output
generation.
9. FUTURE SCOPE
Cipher encryption and decryption projects have a wide range of applications and a promising
future scope in various domains.
Cybersecurity: Encryption and decryption techniques are crucial for securing data
transmission and storage in cybersecurity applications. As the need for data privacy and
protection against cyber threats continues to grow, the development of robust and secure
ciphers will remain a priority.
Cryptography: Cryptography is the foundation of secure communication systems, and
cipher algorithms are at the heart of modern cryptography. Ongoing research in
cryptography aims to develop new ciphers and improve existing ones to enhance security,
efficiency, and resistance against attacks.
Cloud computing and data storage: As more data is stored and processed in the cloud,
encryption and decryption techniques play a crucial role in protecting sensitive information
from unauthorized access. Cloud service providers and data centers rely on robust ciphers
to ensure data confidentiality and integrity.
E-commerce and financial transactions: Secure online transactions and financial data
exchange require strong encryption protocols to protect sensitive information, such as
credit card numbers and personal data. Cipher algorithms are essential for ensuring the
security of e-commerce platforms and financial systems.
10. CONCLUSION
This project aims to enhance data security through the development of a robust encryption and
decryption system. By leveraging advanced cryptographic techniques and ensuring ease of use,
the system will provide secure and reliable protection for sensitive information, making it an
invaluable tool in the fight against cyber threats.
11. REFERENCE
1. https://github.com/cliffordebayan/Caesar-Cipher
2. https://www.scribd.com/doc/221104536/148816-3041-Encryption-Decryption-Project
3. https://www.linkedin.com/pulse/project-encryption-decryption-string-using-c-amrutha-
swamy-8plxc