0% found this document useful (0 votes)
29 views3 pages

Information and Network Security: 1. Statement

The document discusses three encryption techniques: 1) Caesar cipher: A simple substitution cipher that shifts letters by a fixed number. 2) Monoalphabetic cipher: Implements a monoalphabetic substitution cipher that encrypts input text into ciphertext using a given cipher alphabet. It then decrypts the ciphertext back to the original plaintext. 3) Playfair cipher: The document states that the Playfair cipher will be implemented but does not include the program or output for it.

Uploaded by

fallli
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)
29 views3 pages

Information and Network Security: 1. Statement

The document discusses three encryption techniques: 1) Caesar cipher: A simple substitution cipher that shifts letters by a fixed number. 2) Monoalphabetic cipher: Implements a monoalphabetic substitution cipher that encrypts input text into ciphertext using a given cipher alphabet. It then decrypts the ciphertext back to the original plaintext. 3) Playfair cipher: The document states that the Playfair cipher will be implemented but does not include the program or output for it.

Uploaded by

fallli
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/ 3

Information and Network Security

1. Statement: Ceaser Cipher


 Program:

 Output:

2. Statement: Implement Monoalphabetic Cipher


 Program:

package mono;

import java.util.Scanner;

public class Mono {

public static void main(String[] args) {


//Initialization
char[] ar =
{'a','j','l','b','k','i','c','d','n','h','m','e','w','y','x'
,'o','f','z','p','g','q','u','t','r','v','s'};
String input;
Boolean invalidData=false;
Scanner sc=new Scanner(System.in);

System.out.println("Enter PT:");
input = sc.next();
//System.out.println("Line:"+input);

char[] CT = new char[input.length()];

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


{
int num=(int)input.charAt(i);
int round=(num-97);
if (round>=0 && round<=25) {
CT[i]=ar[round];
}
else
{
invalidData=true;
}
}
if (invalidData) {
System.out.println("Enter Input between a-
z...!!!");
return;
}
String CTT=new String(CT);
System.out.println("Cipher Text is:\n"+CTT);

//Decipher
char[] DCT = new char[CT.length];
for (int i = 0; i < CT.length; i++) {
for (int j = 0; j < ar.length; j++) {
if (ar[j]==(CT[i])) {
DCT[i]=(char)(j+97);
}
}

System.out.println("PlainText is:\n"+new
String(DCT));
}

 Output:
Enter PT:
hello
Cipher Text is:
dkeex
PlainText is:
Hello

 Statement: Implement Playfair Cipher


 Program:
 Output:

You might also like