Encryption and Decryption
Encryption and Decryption
PROJECT REPORT
Submitted by
S.HARESH
Register No: 21105084
D.DANIEL GABRIEL
Register No: 21105076
D.S.KAARMUGILAN
Register No:21105089
in partial fulfillment for the award of the degree
of
BACHELOR OF COMPUTER APPLICATIONS
in
DEPARTMENT OF COMPUTER APPLICATIONS
1
SRI RAMAKRISHNA COLLEGE OF ARTS AND SCIENCE
COIMBATORE 641006
BONAFIDE CERTIFICATE
--------------------------- --------------------------
SIGNATURE OF THE GUIDE SIGNATURE OF THE HOD
---------------------- ---------------------
INTERNAL EXAMINER EXTERNAL EXAMINER
2
ACKNOWLEDGEMENT
We are grateful to Dr. D. Hari Prasad, HOD and Dr. S. Gomathi @ Rohini, Project
Coordinator of Department of Computer Applications for their unlisted guidance and
encouragement to accomplish this project.
We also express our thanks to other staff for their help and constant support to
complete the project.
We have great pleasure in thanking our parents and friends for their inspiration and
encouragement. We express our gratitude to various authors, whose works we referred
to carry out this project.
3
LIST OF CONTENTS
1. ABSTRACT 5
3. IMPORTANCE OF ENCRYPTION 7
7. FLOW CHART 11
8. SOURCE CODE 12
9. OUTPUT 13
10. CONCLUSION. 14
4
ABSTRACT
5
ENCRYPTION AND DECRYPTION IN C
Overview
Encryption is the method by which information is converted into secret code that hides the
information's true meaning. The science of encrypting and decrypting information is called
cryptography. In computing, unencrypted data is also known as plaintext, and encrypted data
is called ciphertext. The formulas used to encode and decode messages are called encryption
algorithms, or ciphers. To be effective, a cipher includes a variable as part of the algorithm.
The variable, which is called a key, is what makes a cipher's output unique. When an
encrypted message is intercepted by an unauthorized entity, the intruder has to guess which
cipher the sender used to encrypt the message, as well as what keys were used as variables.
The time and difficulty of guessing this information is what makes encryption such a valuable
security tool. Encryption has been a longstanding way for sensitive information to be
protected. Historically, it was used by militaries and governments. In modern times,
encryption is used to protect data stored on computers and storage devices, as well as data in
transit over networks.
6
IMPORTANCE OF ENCRYPTION
7
HOW ENCRYPTION USED
Encryption is commonly used to protect data in transit and data at rest. Every time
someone uses an ATM or buys something online with a smartphone, encryption is used to
protect the information being relayed.
Businesses are increasingly relying on encryption to protect applications and sensitive
information from reputational damage when there is a data breach.
There are three major components to any encryption system: the data, the encryption
engine and the key management. In laptop encryption, all three components are running or
stored in the same place: on the
laptop. In application architectures, however, the three components usually run or are stored
in separate places to reduce the chance that compromise of any single component could result
in compromise of the entire system.
8
SYMMETRIC AND ASYMMETRIC CIPHER
Symmetric ciphers, also referred to as secret key encryption, use a single key. The key is
sometimes referred to as a shared secret because the sender or computing system doing the
encryption must share the secret key with all entities authorized to decrypt the message.
Symmetric key encryption is usually much faster than asymmetric encryption. The most
widely used symmetric key cipher is the Advanced Encryption Standard (AES), which was
designed to protect government-classified information. Asymmetric ciphers, also known as
public key encryption, use two different -- but logically linked -- keys. This type of
cryptography often uses prime numbers to create keys since it is computationally difficult to
factor large prime numbers and reverse-engineer the encryption. The Rivest-Shamir-Adleman
(RSA) encryption algorithm is currently the most widely used public key algorithm. With
RSA, the public or the private key can be used to encrypt a message; whichever key is not
used for encryption becomes the decryption key. Today, many cryptographic processes use a
symmetric algorithm to encrypt data and an asymmetric algorithm to securel
9
ENCRYPTION KEY MANAGEMENT AND WRAPPING
Encryption is an effective way to secure data, but the cryptographic keys must be carefully
managed to ensure data remains protected, yet accessible when needed. Access to encryption
keys should be monitored and limited to those individuals who absolutely need to use them.
Strategies for managing encryption keys throughout their lifecycle and protecting them from
theft, loss or misuse should begin with an audit to establish a benchmark for how the
organization configures, controls, monitors and manages access to its keys. Key management
software can help centralize key management, as well as protect keys from unauthorized
access, substitution or modification.
Key wrapping is a type of security feature found in some key management software suites
that essentially encrypts an organization's encryption keys, either individually or in bulk. The
process of decrypting keys that have been wrapped is called unwrapping. Key wrapping and
unwrapping activities are usually carried out with symmetric encryption.
10
FLOW CHART
11
SOURCE CODE
#include <stdio.h>
int main()
{
int i, x;
char str[100];
printf("\nPlease enter a string:\t");
gets(str);
printf("\nPlease choose following options:\n");
printf("1 = Encrypt the string.\n");
printf("2 = Decrypt the string.\n");
scanf("%d", &x);
switch(x)
{
case 1:
for(i = 0; (i < 100 && str[i] != '\0'); i++)
str[i] = str[i] + 3;
printf("\nEncrypted string: %s\n", str);
break;
case 2:
for(i = 0; (i < 100 && str[i] != '\0'); i++)
str[i] = str[i] - 3;
printf("\nDecrypted string: %s\n", str);
break;
default:
printf("\nError\n");
}
return 0;
}
12
OUTPUT
13
CONCLUSION
14