0% found this document useful (0 votes)
97 views15 pages

PWP Report

This document describes a student project to develop a Python program for encoding and decoding messages using substitution ciphers. The program will take plaintext as input and encode it using a specified substitution cipher algorithm. It will also decode encrypted ciphertext back to the original plaintext. The document includes an introduction to substitution ciphers, the proposed methodology for developing the program, and an acknowledgment section thanking those involved in guiding the project.

Uploaded by

comedy lover
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views15 pages

PWP Report

This document describes a student project to develop a Python program for encoding and decoding messages using substitution ciphers. The program will take plaintext as input and encode it using a specified substitution cipher algorithm. It will also decode encrypted ciphertext back to the original plaintext. The document includes an introduction to substitution ciphers, the proposed methodology for developing the program, and an acknowledgment section thanking those involved in guiding the project.

Uploaded by

comedy lover
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

PROJECT

ON
Encoding and decoding of message using
Substitution Cipher in python.

DIPLOMA ENGINEERING
IN
(COMPUTER ENGINEERING)

SUBMITTED BY

PRATHMESH KHANDARE
KAPIL TALI
BHAVESH RATHOD
YASH BANAIT

UNDER THE GUIDANCE OF


Dr. G. R. GOSAVI

DEPARTMENT OF COMPUTER ENGINEERING


DR.PANJABRAO DESHMUKH POLYTECHNIC, AMRAVATI
2022-2023

1|Page
DEPARTMENT OF COMPUTER ENGINEERING
DR.PANJABRAO DESHMUKH POLYTECHNIC, AMRAVATI
(A Govt. Aided Institute)

CERTIFICATE

This is to certify that the Mr./Ms. Prathmesh S. Khandare, Kapil A.Tali ,


Bhavesh V. Rathod , Yash A. Banait , of sixth Semester of Diploma in
Computer Engineering has completed the micro-project work /
Project entitled ‘Encoding and decoding of message using Substitution
Cipher in python’ satisfactorily in the partial fulfillment of Micro-
Project for the academic year 2022-23 as prescribed in the
curriculum.

Guide and HOD/Principal


(Dr.G.R.Gosavi)

2|Page
ACKNOWLEDGMENT

The making of the dissertation needed co-operation and guidance of number of


People. We therefore consider it my prime duty to thank all those who had helped
me through his venture.
We are profoundly gratefully to Dr..G.R.Gosavi guidance and continuous
encouragement throughout to that seminar right on its target its commencement to
its completion.
We would like to express my deepest appreciation towards Dr..G.R.Gosavi,
Completing the dissertation.
We would like to thank Principal Dr..G.R.Gosavi , for providing necessary facility,

guidance and valuable time during the period of working on this dissertation.

Thank you!

3|Page
INDEX

Sr.No Content Page no

1 Proposal of the Project

2 Problem Definition 5

3 Introduction 6

4 Brief Information 7-8

Proposed Methodology
1) Methodology
2) Program code

3) Output of the microproject

5 9-12
6 Advantages and Limitations 12-13

7 Conclusion 14

8 References 15

4|Page
Problem Definition:

The goal of this project is to create a Python program that can encode and decode
messages using various encryption techniques. The program should be able to take
any input message, and encode it using a specified encryption algorithm. Similarly,
it should also be able to decode any encrypted message using the same algorithm to
recover the original message.

The project will require the implementation of various encryption techniques, such
as symmetric key encryption (AES, DES), asymmetric key encryption (RSA), and
hash functions (SHA-1, SHA-256). The program should allow the user to choose
which encryption technique to use, and also provide options for key generation and
management.

Additionally, the program should have a user-friendly interface that allows for easy
input and output of messages, as well as the ability to save and load encrypted
messages. The program should also have error handling for invalid inputs and key
mismatches.

5|Page
INTRODUCTON

In today's digital age, privacy and security of data have become increasingly
important. With the rise of internet-based communication, it has become easier to
share information with people across the globe. However, this ease of
communication has also made it easier for malicious actors to intercept and read
sensitive information. This is where encryption comes into play. Encryption is the
process of converting plaintext into ciphertext to protect the confidentiality of data.

The aim of this project is to develop a Python program that can encode and decode
messages using various encryption techniques. The program will use several
encryption algorithms, such as symmetric key encryption (AES, DES), asymmetric
key encryption (RSA), and hash functions (SHA-1, SHA-256). The program will
enable users to choose which encryption technique to use, and also provide options
for key generation and management.

The program's user interface will be user-friendly, allowing for easy input and
output of messages. The program will also have the ability to save and load
encrypted messages. Error handling will be implemented to detect invalid inputs
and key mismatches.

The implementation of symmetric key encryption techniques like AES (Advanced


Encryption Standard) and DES (Data Encryption Standard) will ensure that the
program provides strong encryption to protect user data. Asymmetric key
encryption techniques like RSA (Rivest–Shamir–Adleman) will also be
implemented to provide a secure way of sharing keys between parties.

The program's use of hash functions like SHA-1 (Secure Hash Algorithm 1) and
SHA-256 (Secure Hash Algorithm 256) will ensure that the program provides data
integrity by verifying that the message has not been tampered with during
transmission.

In conclusion, this project will enable users to encode and decode messages
securely, using various encryption techniques. The user-friendly interface, error
handling, and strong encryption algorithms make this program a valuable tool for
anyone who wants to protect their privacy and security of their data.

6|Page
BRIEF INFORMATION

Substitution Cipher is a type of encryption technique that replaces each letter or group
of letters in the plaintext with another letter or group of letters in the ciphertext. This
type of cipher is known as a monoalphabetic substitution cipher because each letter is
replaced with a unique letter, symbol or number.

In a substitution cipher, the key is the mapping between the plaintext and the
ciphertext. The key is used to encrypt the plaintext, and it can also be used to decrypt
the ciphertext back into plaintext. The key must be kept secret to prevent unauthorized
access to the message.

There are different types of substitution ciphers, such as the Caesar Cipher, Atbash
Cipher, Polybius Square Cipher, and Vigenere Cipher. Each of these ciphers uses a
different technique to perform the substitution.

One weakness of a monoalphabetic substitution cipher is that the same plaintext letter
always maps to the same ciphertext letter. This can be exploited by an attacker to
perform frequency analysis and break the cipher. To overcome this weakness,
polyalphabetic substitution ciphers were developed. A polyalphabetic substitution
cipher uses multiple substitution alphabets, and the key determines which substitution
alphabet to use for each letter in the plaintext.

Substitution ciphers were commonly used in the past, and they are still used today in
some applications, such as secret codes and puzzles. However, they are not considered
secure for modern cryptographic purposes because they are vulnerable to brute-force
attacks and other cryptanalytic techniques.

Algorithm for Substitution Cipher:

Input:

A String of both lower and upper case letters, called PlainText.


An Integer denoting the required key.

Procedure:

7|Page
1) Create a list of all the characters.
2) Create a dictionary to store the substitution for all characters.
3) For each character, transform the given character as per the rule, depending on
whether we’re encrypting or decrypting the text.
4) Print the new string generated.

8|Page
PROPOSED METHODOLOGY

The first step in developing the program is to define the requirements. This involves
determining the encryption techniques to be used, the user interface requirements,
and any other relevant features. Based on the requirements, the program
architecture is designed, including the various components and how they will
interact with each other. Once the architecture is designed, the program is
developed, including implementing the encryption algorithms, creating the user
interface, and developing any other features required.

After developing the program, it is thoroughly tested to ensure that it meets the
requirements and functions as intended. This includes testing for any potential
vulnerabilities or errors. If any issues are identified during testing, necessary
changes are implemented to the program. After the program is tested and validated,
it is deployed to the target system(s).

Throughout the development process, it is important to ensure that the program's


code is well-documented and adheres to best coding practices. This makes it easier
to maintain and update the program in the future. Additionally, it is important to
consider the program's scalability and how it can be expanded to support additional
features or encryption techniques in the future. Finally, the program's security
should be considered, including the management of encryption keys and ensuring
that the program does not store any sensitive data in plain text.

Program code :

import tkinter as tk

# Define the encoding and decoding functions def


encode(plaintext, key):
# Generate the substitution cipher by shifting the alphabet by the key
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
shifted_alphabet = alphabet[key:] + alphabet[:key]
substitution_cipher = str.maketrans(alphabet, shifted_alphabet)

9|Page
# Apply the substitution cipher to the plaintext
ciphertext = plaintext.upper().translate(substitution_cipher)
return ciphertext

def decode(ciphertext, key):


# Generate the substitution cipher by shifting the alphabet by the key
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
shifted_alphabet = alphabet[key:] + alphabet[:key]
substitution_cipher = str.maketrans(shifted_alphabet, alphabet)

# Apply the substitution cipher to the ciphertext


plaintext = ciphertext.translate(substitution_cipher)
return plaintext

# Define the GUI root


= tk.Tk()
root.title("Substitution Cipher Encoder/Decoder")
# Create the text fields and labels plaintext_label =
tk.Label(root, text="Text:")
plaintext_label.grid(row=0, column=0, sticky="w")
plaintext_entry = tk.Entry(root)
plaintext_entry.grid(row=0, column=1)

key_label = tk.Label(root, text="Key (0-25):")


key_label.grid(row=1, column=0, sticky="w") key_entry
= tk.Entry(root)
key_entry.grid(row=1, column=1)

result_label = tk.Label(root, text="Result:") result_label.grid(row=2,


column=0, sticky="w")
result_entry = tk.Entry(root)
result_entry.grid(row=2, column=1)

# Create the encode and decode buttons


def encode_text(): plaintext =

10 | P a g e
plaintext_entry.get() key =
int(key_entry.get()) ciphertext =
encode(plaintext, key)
result_entry.delete(0, tk.END)
result_entry.insert(0, ciphertext) encode_button = tk.Button(root,
text="Encode", command=encode_text) encode_button.grid(row=3,
column=0
def decode_text(): ciphertext =
plaintext_entry.get() key =
int(key_entry.get()) plaintext =
decode(ciphertext, key)
result_entry.delete(0, tk.END)
result_entry.insert(0, plaintext)
decode_button = tk.Button(root, text="Decode", command=decode_text)
decode_button.grid(row=3, column=1) root.mainloop()

Output of the Project


Encoding :

Decoding :

11 | P a g e
Advantages of system :

1. Improved Security: The primary advantage of using encryption techniques to


encode messages is that it provides improved security. With encryption, the
message is transformed into an unreadable format, which makes it difficult for
unauthorized users to intercept and understand the message's content. This can
help prevent sensitive data from falling into the wrong hands.

2. Customizability: Another advantage of developing a Python program for


encoding and decoding messages is that it can be customized according to
specific needs. Users can choose from a range of encryption techniques and
algorithms to use, depending on the level of security needed for their messages.
This customizability makes the program highly adaptable and useful in a variety
of settings.

3. Ease of Use: With a user-friendly interface, the program is easy to use, even for
those without technical expertise in encryption. The program's simple input and
output mechanisms make it easy for users to encode and decode messages.

4. Cost-Effective: Developing a Python program for encoding and decoding


messages is cost-effective compared to purchasing expensive commercial
software. This program provides a viable alternative that can be customized to
meet specific needs and provide improved security.

5. Transferability: The program can be used on various operating systems,


including Windows, macOS, and Linux, making it easily transferable between
systems. This means that users can encrypt and decrypt

12 | P a g e
Limitations :

1. Processing Power: Encryption and decryption of messages using advanced


encryption algorithms require significant processing power. As a result, the
program may not run efficiently on low-end systems or devices with limited
processing power.

2. Key Management: The use of encryption techniques requires the management of


encryption keys to ensure the security of the messages. If the keys are not
managed appropriately, there is a risk of losing access to encrypted messages.

3. User Knowledge: The program's customizability and ease of use are advantages,
but users need to have a basic understanding of encryption and decryption to use
the program effectively. Otherwise, they may not know which encryption
techniques to use or how to manage encryption keys.

4. Compatibility: Encryption techniques and algorithms are not always compatible


with all types of data or devices. For example, if a message is encrypted using a
specific encryption algorithm, the recipient must also have access to the same
algorithm to decrypt the message.

5. False Sense of Security: Encryption provides improved security, but it is not


foolproof. If the encryption keys or algorithms are compromised, unauthorized
users may still be able to access the messages. Additionally, users may develop
a false sense of security and become less vigilant about protecting their data.

13 | P a g e
CONCLUSION
In conclusion, developing a Python program for encoding and decoding messages
using encryption techniques can provide significant advantages, such as improved
security, customizability, ease of use, cost-effectiveness, and transferability. However,
it is essential to consider the limitations of the program, such as processing power
requirements, key management, user knowledge, compatibility issues, and the risk of
developing a false sense of security. Despite these limitations, a well-designed Python
program for encoding and decoding messages can be a valuable tool for individuals
and organizations that need to secure their data and maintain confidentiality. With
careful consideration of its advantages and limitations, such a program can provide a
useful and efficient way to encode and decode messages using encryption techniques.

14 | P a g e
References

Website Reference:

javatpoint.com

researchgate.com

scribd.com

www.oracle.com

www.geeksforgeeks.com

15 | P a g e

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy