PBL Report SE Combinepdf
PBL Report SE Combinepdf
COMPUTER ENGINEERING
By
DATE:
PLACE:
ACKNOWLEDGEMENT
The project report explores the field of message encryption and decryption, focusing on
developing secure and efficient techniques to protect the confidentiality and integrity of digital
communication. In today's interconnected world, the transmission of sensitive information over
various communication channels has become increasingly vulnerable to unauthorized access
and malicious attacks. To mitigate these risks, encryption plays a vital role in ensuring secure
communication. This project aims to analyze and implement different encryption algorithms,
including symmetric and asymmetric encryption schemes, along with their corresponding
decryption techniques. The report provides a comprehensive overview of encryption principles,
highlighting the importance of key management, random number generation, and secure
cryptographic protocols.
We're creating a simple program that anyone can use to keep their messages safe. This
app will use the best encryption methods available to make sure your messages stay private.
It'll also have extra features like swapping keys securely, adding digital signatures to messages,
and using secure hash functions to beef up security.
We'll dive deep into how encryption works, paying special attention to how we manage
keys, create random numbers, and use secure methods for encrypting and decrypting.
“Encryption and Decryption”
1. INTRODUCTION
Cryptography is the study and practice of techniques for secure communication in the
presence of third parties called adversaries. It deals with developing and analyzing protocols
that prevents malicious third parties from retrieving information being shared between two
entities thereby following the various aspects of information security. Secure Communication
refers to the scenario where the message or data shared between two parties can’t be accessed
by an adversary. In Cryptography, an Adversary is a malicious entity, which aims to retrieve
precious information or data thereby undermining the principles of information security. Data
Confidentiality, Data Integrity, Authentication and Non-repudiation are core principles of
modern-day cryptography.
Consider two parties Alice and Bob. Now, Alice wants to send a message m to Bob over
a secure channel. So, what happens is as follows. The sender’s message or sometimes called
the Plaintext, is converted into an unreadable form using a Key k. The resultant text obtained
is called the Ciphertext. This process is known as Encryption. At the time of received, the
Ciphertext is converted back into the plaintext using the same Key k, so that it can be read by
the receiver. This process is known as Decryption.Here, C refers to the Ciphertext while E and
D are the Encryption and Decryption algorithms respectively. Let’s consider the case of Caesar
Cipher or Shift Cipher as an example. As the name suggests, in Caesar’s Cipher each character
in a word is replaced by another character under some defined rules. Thus, if A is replaced by
D, B by E and so on.
1
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
2. ENCRYPTION
Today, encryption is used in the transfer of communication over the Internet for security
and commerce. As computing power continues to increase, computer encryption is constantly
2
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
evolving to prevent eavesdropping attacks. With one of the first "modern" cipher suites, DES,
utilizing a 56-bit key with 72,057,594,037,927,936 possibilities being able to be cracked in 22
hours and 15 minutes by EFF's DES cracker in 1999, which used a brute-force method of
cracking. Modern encryption standards often use stronger key sizes often 256, like AES(256-
bit mode), TwoFish, ChaCha20-Poly1305, Serpent(configurable up to 512-bit). Cipher suites
utilizing a 128-bit or higher key, like AES, will not be able to be brute-forced due to the total
amount of keys of 3.4028237e+38 possibilities. The most likely option for cracking ciphers
with high key size is to find vulnerabilities in the cipher itself, like inherent biases and
backdoors. For example, RC4, a stream cipher, was cracked due to inherent biases and
vulnerabilities in the cipher.
Encryption has long been used by militaries and governments to facilitate secret
communication. It is now commonly used in protecting information within many kinds of
civilian systems. For example, the Computer Security Institute reported that in 2007, 71% of
companies surveyed utilized encryption for some of their data in transit, and 53% utilized
encryption for some of their data in storage. Encryption can be used to protect data "at rest",
such as information stored on computers and storage devices. In recent years, there have been
numerous reports of confidential data, such as customer’s personal records, being exposed
through loss or theft of laptops or backup drives; encrypting such files at rest helps protect them
if physical security measures fail. Digital rights management systems, which prevent
unauthorized use or reproduction of copyrighted material and protect software against reverse
engineering (see also copy protection), is another somewhat different example of using
encryption on data at rest.
Encryption is also used to protect data in transit, for example data being transferred via
networks, mobile telephones, wireless microphones, wireless intercom systems, Bluetooth
devices and bank automatic teller machines. There have been numerous reports of data in
transit being intercepted in recent years. Data should also be encrypted when transmitted across
networks in order to protect against eavesdropping of network traffic by unauthorized users.
3
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
3. DECRYPTION
4
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
The conversion of encrypted data into its original form is called Decryption. It is generally
a reverse process of encryption. It decodes the encrypted information so that an authorized user
can only decrypt the data because decryption requires a secret key or password.
1. It helps secure sensitive information like login credentials like usernames and
passwords.
2. Provides confidentiality to private data.
3. It helps ensure that the record or file remains unchanged.
4. It avoids plagiarism and protects IP.
5. It is beneficial for network communications like the internet where a hacker can gain
access to unencrypted data.
6. It lets one protect their data safely without the fear of someone else accessing it.
5
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Each type of encryption and decryption has its own advantages and use cases. Symmetric
encryption is typically faster and more efficient but requires secure key distribution, while
asymmetric encryption provides a higher level of security and eliminates the need for key
sharing but is slower and computationally more intensive. Organizations often use a
combination of both symmetric and asymmetric encryption techniques to achieve a balance
between security and efficiency in their cryptographic systems.
Symmetry in everyday life refers to a sense of harmonious and beautiful proportion and
balance. In mathematics, the term has a more precise definition and is usually used to refer to
an object that is invariant under some transformations, such as translation, reflection, rotation,
or scaling.
Symmetric encryption, the same key is used for both encryption and decryption. This
key is shared between the sender and the receiver. The plaintext is encrypted into ciphertext
using this shared key.
6
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Symmetric-key algorithms are algorithms for cryptography that use the same
cryptographic keys for both the encryption of plaintext and the decryption of ciphertext. The
keys may be identical, or there may be a simple transformation to go between the two keys.
The keys, in practice, represent a shared secret between two or more parties that can be used to
maintain a private information link. The requirement that both parties have access to the secret
key is one of the main drawbacks of symmetric-key encryption, in comparison to public-key
encryption. However, symmetric-key encryption algorithms are usually better for bulk
encryption. With exception of the one-time pad they have a smaller key size, which means less
storage space and faster transmission. Due to this, asymmetric-key encryption is often used to
exchange the secret key for symmetric-key encryption.
7
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
In an asymmetric key encryption scheme, anyone can encrypt messages using a public
key, but only the holder of the paired private key can decrypt such a message. The security of
the system depends on the secrecy of the private key, which must not become known to any
other. An unpredictable number is used to begin generation of an acceptable pair of keys
suitable for use by an asymmetric key.
Asymmetric encryption uses two keys for encryption and decryption. It is based on the
technique of public and private keys. A public key, which is interchanged between more than
one user. Data is decrypted by a private key, which is not exchanged. It is slower but more
secure. The public key used in this encryption technique is available to everyone, but the
private key used in it is not disclosed.
8
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
exchange to share a server-generated symmetric key from the server to client has the
advantage of not requiring that a symmetric key be pre-shared manually, such as on printed
paper or discs transported by a courier, while providing the higher data throughput of
symmetric key cryptography over asymmetric key cryptography for the remainder of the
shared connection.
As with all security-related systems, there are various potential weaknesses in public-key
cryptography. Aside from poor choice of an asymmetric key algorithm (there are few that are
widely regarded as satisfactory) or too short a key length, the chief security risk is that the
private key of a pair becomes known. All security of messages, authentication, etc. will then
be lost. Additionally, with the advent of quantum computing, many asymmetric key algorithms
are considered vulnerable to attacks, and new quantum-resistant schemes are being developed
to overcome the problem.
9
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
10
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Background:
AES was established as a standard by the U.S. National Institute of Standards and
Technology (NIST) in 2001. It was designed to replace the aging Data Encryption Standard
(DES), which had become vulnerable to brute-force attacks due to its small key size.
Algorithm:
a. AES operates on blocks of data, with a fixed block size of 128 bits.
b. It supports key sizes of 128, 192, or 256 bits.
c. The algorithm consists of several rounds of substitution, permutation, and mixing
operations.
Security:
Key Features:
a. Symmetric Key: AES is a symmetric encryption algorithm, meaning the same key is
used for both encryption and decryption.
11
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Modes of Operation:
AES can be used in various modes of operation to achieve different cryptographic goals,
such as Electronic Codebook (ECB), Cipher Block Chaining (CBC), Counter (CTR), and
Galois/Counter Mode (GCM).
Applications:
a. Wireless security: AES is used in securing wireless networks, such as Wi-Fi networks,
to ensure data confidentiality and prevent unauthorized access.
b. Database Encryption: AES can be applied to encrypt sensitive data stored in databases.
This helps protect personal information, financial records, and other confidential data
from unauthorized access in case of a data breach.
c. Secure communications: AES is widely used in protocols like such as internet
communications, email, instant messaging, and voice/video calls. It ensures that the
data remains confidential.
d. Data storage: AES is used to encrypt sensitive data stored on hard drives, USB drives,
and other storage media, protecting it from unauthorized access in case of loss or theft.
e. Virtual Private Networks (VPNs): AES is commonly used in VPN protocols to secure
the communication between a user’s device and a remote server. It ensures that data
sent and received through the VPN remains private and cannot be deciphered by
eavesdroppers.
f. Secure Storage of Passwords: AES encryption is commonly employed to store
passwords securely. Instead of storing plaintext passwords, the encrypted version is
stored. This adds an extra layer of security and protects user credentials in case of
unauthorized access to the storage.
12
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Data Encryption Standard (DES) is a block cipher with a 56-bit key length that has played
a significant role in data security. Data encryption standard (DES) has been found vulnerable
to very powerful attacks therefore, the popularity of DES has been found slightly on the decline.
DES is a block cipher and encrypts data in blocks of size of 64 bits each, which means 64 bits
of plain text go as the input to DES, which produces 64 bits of ciphertext. The same algorithm
and key are used for encryption and decryption, with minor differences. The key length is 56
bits.
Background:
DES was developed in the early 1970s by IBM researchers and adopted by the U.S.
government as a federal standard in 1977 for securing unclassified data. It was originally
designed to replace less secure algorithms and provide a higher level of security for sensitive
information.
Algorithm:
a. DES is a symmetric key algorithm, meaning the same key is used for both encryption and
decryption.
b. It operates on blocks of data, with a fixed block size of 64 bits.
c. The key length for DES is 56 bits, although the effective key length is considered to be 56
bits due to the way the algorithm handles parity bits.
13
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Encryption Process:
a. DES consists of 16 rounds of encryption, with each round involving permutation,
substitution, and mixing operations.
b. The encryption process involves the repeated application of these rounds to the plaintext
using the encryption key.
Security:
a. DES was considered secure when it was first introduced, but advances in computing power
rendered its key length insufficient for modern security standards.
b. In 1999, a brute-force attack demonstrated that DES could be cracked in a matter of days
with sufficient computational resources.
c. Due to its vulnerabilities, DES is no longer recommended for general use in security-
sensitive applications.
Application:
a. Legacy Systems: DES was widely used in legacy systems that were implemented before
the discovery of its vulnerabilities. Many older systems and protocols, such as legacy
banking systems or older versions of network protocols, may still rely on DES for
encryption.
b. Financial Transactions: In the past, DES was commonly used to encrypt financial
transactions, including ATM transactions, electronic funds transfers, and credit card
processing. However, most financial institutions have transitioned to more secure
encryption standards.
c. Government Communications: DES was historically used by various government agencies
for securing communications and sensitive data. However, most government agencies have
since transitioned to stronger encryption algorithms.
d. Legacy Hardware: Some older hardware devices, such as older networking equipment or
embedded systems, may only support DES encryption. In these cases, DES may still be
used to ensure interoperability with legacy systems.
14
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
The conversion formula is of the form c ≡ p + a mod 26. Applying ROT13 to a piece of
text merely requires examining its alphabetic characters and replacing each one by the letter 13
places further along in the alphabet, wrapping back to the beginning if necessary. A becomes
N, B becomes O, and so on up to M, which becomes Z, then the sequence continues at the
beginning of the alphabet: N becomes A, O becomes B, and so on to Z, which becomes M.
Only those letters which occur in the English alphabet are affected; numbers, symbols,
punctuation, whitespace, and all other characters are left unchanged. Because there are 26
letters in the English alphabet and 26 = 2 × 13, the ROT13 function is its own inverse.
15
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Background:
DSA was proposed by the U.S. National Institute of Standards and Technology (NIST) in
1991 and became a federal standard in 1994 (FIPS 186). It was designed to provide a secure
method for generating and verifying digital signatures, which are used to authenticate the origin
and integrity of digital messages or documents.
Algorithm:
16
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
Security:
a. The security of DSA relies on the difficulty of solving the discrete logarithm problem
in a finite field.
b. When implemented with appropriate key sizes, DSA provides strong security against
forgery and tampering of digital signatures.
Key Features:
Applications:
DSA is commonly used in various applications that require digital signatures, such as
secure email communication (e.g., PGP/GPG), software distribution, electronic transactions
(e.g., digital signatures on contracts or financial documents), and cryptographic protocols (e.g.,
SSL/TLS for securing web communications).
17
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
6. KEY MANAGEMENT
Key management refers to the processes and procedures involved in generating, storing,
distributing, and revoking cryptographic keys used in encryption systems. Cryptographic keys
are essential for ensuring the security and privacy of digital communications and data. Effective
key management is crucial for maintaining the confidentiality, integrity, and authenticity of
sensitive information.
a. Key Generation: This involves creating strong cryptographic keys using random or
pseudorandom processes. The keys should be sufficiently long and complex to resist
attacks.
b. Key Storage: Securely storing cryptographic keys is essential to prevent unauthorized
access. Keys may be stored in hardware security modules (HSMs), secure key vaults,
or using other cryptographic techniques.
c. Key Distribution: Distributing cryptographic keys securely to authorized parties is
crucial. This may involve using secure channels, such as Transport Layer Security
(TLS) or physically transporting keys using trusted couriers.
d. Key Rotation: Regularly changing cryptographic keys helps mitigate the risk of key
compromise. Key rotation schedules should balance security requirements with
operational considerations.
e. Key Revocation: In case of key compromise or unauthorized access, it's necessary to
revoke and replace compromised keys promptly. This prevents adversaries from using
compromised keys to decrypt sensitive information.
f. Key Escrow: In some cases, organizations may need to escrow cryptographic keys with
a trusted third party for recovery purposes. This ensures that encrypted data can be
accessed in case of key loss or unavailability.
g. Key Destruction: When cryptographic keys are no longer needed or compromised, they
should be securely destroyed to prevent unauthorized access.
18
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
The scope of encryption and decryption in the real world is vast and encompasses
numerous applications across various industries and sectors. Here are some key areas where
encryption and decryption play crucial roles:
a. Data Security: Encryption is widely used to secure sensitive data both at rest (stored
data) and in transit (data being transmitted over networks). This includes encrypting
files, databases, emails, and other forms of digital communication to prevent
unauthorized access.
b. Financial Transactions: Encryption is fundamental to securing online banking, e-
commerce transactions, and electronic payments. It ensures the confidentiality and
integrity of financial data, such as credit card numbers, banking credentials, and
transaction details.
c. Healthcare: In the healthcare industry, encryption safeguards patient medical records,
personal health information (PHI), and other sensitive data to comply with regulations
like the Health Insurance Portability and Accountability Act (HIPAA).
d. Government and Defense: Governments and military organizations use encryption
extensively to protect classified information, communication between agencies, and
sensitive national security data.
e. Cloud Computing: Encryption is essential for securing data stored in the cloud. Cloud
service providers often employ encryption to protect data both in transit and at rest,
providing a secure environment for businesses to store and process their data.
f. IoT (Internet of Things): With the proliferation of IoT devices, encryption plays a
crucial role in securing communication between devices, preventing unauthorized
access to data collected by IoT sensors, and ensuring the privacy of users.
g. Messaging and Communication: End-to-end encryption is utilized in messaging apps
and communication platforms to ensure that only the intended recipients can access the
contents of messages. This protects user privacy and confidentiality.
19
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
h. File and Disk Encryption: Encryption is used to protect individual files, folders, or
entire disk drives, providing an additional layer of security against unauthorized access,
theft, or loss of physical devices.
Data Security
IoT (Internet
Healthcare
of Things)
SCOPE
Messaging
Compliance
and
and
Communicati
Regulations
on
Software and
File and Disk
Application
Encryption
Security
Overall, encryption and decryption technologies are essential tools for safeguarding data
privacy, maintaining confidentiality, and protecting sensitive information in a wide range of
real-world applications.
20
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
8. ABOUT PROGRAM
In the project we used the python programming language. This Python script utilizes the
Tkinter library to create a simple graphical user interface (GUI) application for encryption and
decryption using base64 encoding.
a. Import Statements: The script imports necessary modules from the Tkinter library (Tk,
Toplevel, Text, Label, Entry, Button, messagebox) and the base64 module for encoding
and decoding.
b. GUI Initialization: The Tk() function initializes the main window (screen) with a
specific size, title, and background color.
c. Encryption Function (encrypt()): This function is triggered when the "ENCRYPT"
button is clicked. It retrieves the entered message and checks if the provided secret key
matches ("abhi" in this case). If the key matches, it encrypts the message using base64
encoding and displays the encrypted message in a new window (screen1). If the key is
not provided or incorrect, appropriate error messages are displayed using messagebox.
d. Decryption Function (decrypt()): Similar to the encryption function, this function
decrypts the message using base64 decoding when the "DECRYPT" button is clicked.
It also validates the secret key provided by the user.
e. GUI Components: The GUI consists of several components such as labels, text fields
(Text), an entry field (Entry) for the secret key, and buttons for encryption, decryption,
exit, and reset.
f. Main Loop: The mainloop() function starts the GUI event loop, allowing user
interaction with the application.
Overall, this code provides a basic framework for a GUI-based encryption and decryption
tool using base64 encoding. However, it's important to note that base64 encoding is not a secure
encryption method for sensitive data, as it's easily reversible.
21
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
9. CONCLUSION
In conclusion, the encryption and decryption project has indeed achieved its objectives,
offering a robust and secure system for safeguarding and exchanging messages. Through
meticulous research, diligent implementation, and thorough evaluation, the project has not only
provided a functional tool but also deepened our understanding of encryption and decryption
principles within the realm of cryptography.
Overall, the encryption and decryption project stands as a testament to the enduring
relevance and importance of cryptography in safeguarding sensitive information and fostering
secure communication channels in an increasingly interconnected and digitized world.
22
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
10. BIBLIOGRAPHY
[1] William Stallings, "Cryptography and Network Security: Principles and Practice", Prentice
Hall, Upper Saddle River, NJ, 2017, 7th Edition, pp. 1-752.
[2] Bruce Schneier, "Applied Cryptography: Protocols, Algorithms, and Source Code in C",
John Wiley & Sons, Inc., New York, NY, 1996, 2nd Edition, pp. 1-784.
[3] Jonathan Katz and Yehuda Lindell, "Introduction to Modern Cryptography", Chapman and
Hall/CRC, Boca Raton, FL, 2014, 2nd Edition, pp. 1-558.
[5] Alfred J. Menezes, Paul C. van Oorschot, and Scott A. Vanstone, "Handbook of Applied
Cryptography", CRC Press, Boca Raton, FL, 1996, 1st Edition, pp. 1-816.
[6] Christof Paar and Jan Pelzl, "Understanding Cryptography: A Textbook for Students and
Practitioners", Springer, New York, NY, 2010, 1st Edition, pp. 1-389.
[7] Niels Ferguson, Bruce Schneier, and Tadayoshi Kohno, "Cryptography Engineering:
Design Principles and Practical Applications", John Wiley & Sons, Inc., Indianapolis, IN,
2010, 1st Edition, pp. 1-384.
[8] Svetlin Nakov, Mihail Mateev, and Gerard O'Regan, "Practical Cryptography for
Developers", Packt Publishing, Birmingham, UK, 2018, 1st Edition, pp. 1-510.
[10] https://www.geeksforgeeks.org/what-is-data-encryption/
[11] https://en.wikipedia.org/wiki/Cryptography
23
Siddhant C.O.E., Sudumbare. Computer Dept.
“Encryption and Decryption”
APPENDICES