0% found this document useful (0 votes)
15 views10 pages

NIS 2page Final MP

The document outlines a micro-project focused on implementing the Caesar Cipher algorithm for cryptography using Java. It includes sections on the rationale, aims, methodology, and outcomes of the project, detailing how the algorithm encrypts and decrypts messages by shifting letters. Additionally, it discusses the resources used and the learning outcomes achieved through the project.

Uploaded by

moretv2006
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)
15 views10 pages

NIS 2page Final MP

The document outlines a micro-project focused on implementing the Caesar Cipher algorithm for cryptography using Java. It includes sections on the rationale, aims, methodology, and outcomes of the project, detailing how the algorithm encrypts and decrypts messages by shifting letters. Additionally, it discusses the resources used and the learning outcomes achieved through the project.

Uploaded by

moretv2006
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/ 10

TABLE OF CONTENTS

1. Rationale

2. Aim of Micro-Project

3. Course Outcomes Achieved

4. Literature Review

5. Methodology

6. Recourses Used

7. Outcomes of The Micro-Project

8. Learning Outcomes of The Micro-Project

9. Applications
Caesar Cipher using Java

1.0 Rationale
The Caesar Cipher algorithm for cryptography is one of the oldest algorithms. This is because in this
algorithm each character of a message is always replaced by the same fixed character that has been
predetermined. To improve the algorithm and enhance its security feature, a few changes can be
added.

2.0 Aim of Micro-Project:

Caesar protected his confidential information by encrypting it using a cipher. Caesar’s Cipher
shifts each letter by a number of letters. If the shift takes you past the end of the alphabet,
just rotate back to the front of the alphabet.

3.0 Course Outcomes Achieved

c) Apply cryptographic algorithms and protocols to maintain Computer Security.


4.1 Literature Review:

1. Cryptography:-

Cryptology, which is the study of cryptosystems, encompasses two disciplines:


cryptography and cryptanalysis.

Cryptography is concerned with the design of cryptosystems, while cryptanalysis studies the
breaking of cryptosystems (Henk & Van, 2000).The branch of science which deals with secure
communication on presence of intruders is cryptography(Henk & Van, 2000).

It is one of the major areas of study in information security. Others include, but not limited to,
steganography and network security.

Cryptography is defined as the science and art of encrypting and decrypting data using some
special measures.

2. Encryption:-

Encryption is the method of disguising plaintext in such a way as to hide its substance while
decryption (which is the opposite of encryption) is unhiding the substance by changing the cipher
text to its original plaintext (Rhodes-Ousley, 2013).

Cryptanalysis, on the other hand, is the branch of science which deals with breaking the codes and
extracting the hidden meaning, while the whole system which comprises both cryptography and
cryptanalysis is called cryptosystem (Paar & Pelzl, 2010).
5.0 Methodology:
Traverse the given text one character at a time.

For each character, transform the given character as per the rule, depending on whether we’re
encrypting or decrypting the text.

Return the new string generated.

Encryption code:-

import java.util.Scanner;

public class caeser

public static void main(String args[])

String plaintext, encrypted_Message = "";

int key;

char alphabet;

Scanner sc = new Scanner(System.in);

System.out.println("Enter a Plaintext you want to encrypt: ");

plaintext = sc.nextLine();

System.out.println("Enter encrypted key: ");

key = sc.nextInt();

for(int i = 0; i < plaintext.length(); i++)

{ alphabet = plaintext.charAt(i);

if(alphabet >= 'a' && alphabet <= 'z'){


alphabet = (char)(alphabet + key);

if(alphabet > 'z'){

alphabet = (char)(alphabet - 'z' + 'a' - 1);

encrypted_Message += alphabet;

else if(alphabet >= 'A' && alphabet <= 'Z')

{ alphabet = (char)(alphabet + key);

if(alphabet > 'Z')

alphabet = (char)(alphabet - 'Z' + 'A' - 1);

encrypted_Message += alphabet;

else {

encrypted_Message += alphabet;

System.out.println("Encrypted Message is : = " + encrypted_Message);

}
2.Decryption Code:-

import java.util.*;

public class caesardecript

public static void main(String...s)

String ciphertext, decrypted_Message = "";

int key;

char alphabet;

Scanner sc = new Scanner(System.in);

System.out.println("Enter a encrypted message you want to decrypt:

"); ciphertext = sc.nextLine();

System.out.println("Enter decryption key: ");

key = sc.nextInt();

for(int i = 0; i < ciphertext .length(); ++i)

alphabet = ciphertext .charAt(i);


if(alphabet >= 'a' && alphabet <= 'z')

alphabet = (char)(alphabet - key);

if(alphabet < 'a')

alphabet = (char)(alphabet + 'z' - 'a' + 1);

decrypted_Message += alphabet;

else if(alphabet >= 'A' && alphabet <= 'Z')

alphabet = (char)(alphabet - key);

if(alphabet < 'A')

alphabet = (char)(alphabet + 'Z' - 'A' + 1);

decrypted_Message += alphabet;
}

else {

decrypted_Message += alphabet;

System.out.println("Decrypted Message is : = " + decrypted_Message);

6.0 Resource Used

Sr No. Name of Resource Specification Qty Remarks

1 Computer (i3-i5) 8GB RAM 1


7.1 Outcomes of the Micro-Project:

1. Encryption Outcome:-

2. Decryption Outcome:-

8.0 Learning outcome of the Micro-project

In this way we have implement program to encrypt text and decrypt text using substitution
technique like caeser cipher.

9.1 Application
a) Reduces human effort.
b) Provide more security.

You might also like