SlideShare a Scribd company logo
W E M A D E I T !
Akhil Yadav - ENG18CA0008
Devansh Koolwal - ENG18CA0014
BCA-2nd
JAVA PROJECT
Encryption Decryption
Dayananda Sagar University
T h r a s h . j a v a
package encryption.java;
public class thrash {
char[] alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
int[][] alphai={
{42,43,75,76,24,85,68,80,79,82,55,61,26,56,91,28,89,92,19,23,88,87,96,14,52,58},
{81,21,38,72,55,56,69,25,30,88,82,24,34,10,57,79,77,94,18,76,20,98,16,66,40,95},
{31,89,23,17,81,25,63,60,93,75,32,77,19,41,66,20,45,47,65,33,99,29,52,72,76,80},
{10,79,54,59,18,32,38,16,12,71,99,85,34,36,31,17,87,82,94,88,46,93,89,51,13,44},
{29,70,49,52,10,65,44,64,35,39,96,55,17,26,98,75,11,16,21,19,31,15,71,69,81,30},
{87,18,54,62,57,60,83,76,44,91,84,16,69,97,93,51,58,94,98,59,15,61,42,65,81,70},
{31,45,67,79,63,35,53,42,32,77,51,27,90,70,78,14,84,73,37,10,54,95,62,81,22,66}
};
//alphai represents 7 sets of character in numeric form
int [][] numri={
{42,43,75,76,24,85,68,80,79,82},
{81,21,38,72,55,56,69,25,30,88},
{31,89,23,17,81,25,63,60,93,75},
{10,79,54,59,16,31,38,16,12,71},
{29,70,39,52,10,65,64,64,35,39},
{87,18,58,60,51,60,83,76,44,92},
{34,45,67,79,63,37,53,42,34,77},
{78,37,77,12,91,91,36,87,15,52}};
//numri represents 7 sets of Numbers
char [][] stringcase={{'a','c','n','l','o'},{'y','u','r','d','q',},{'s','i','z','w','x'},{'b','e','f','h','j'}};
//stringcase[0][_] - lowercase
//stringcase[1][_] - Uppercase
//stringcase[2][_] - space
//stringcase[3][_] - number
char[] sett={'@','!','"',']','+','%','#'};
//sett represents set index
}
M e s s a g e _ E n c r y p t I o n . j a v a
package encryption;
import javax.swing.JFrame;
import java.util.Random;
import javax.swing.JOptionPane;
public class Message_Encryption extends javax.swing.JFrame{
private void formWindowOpened(java.awt.event.WindowEvent evt) {
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
jLabel1.setHorizontalAlignment(jLabel1.CENTER);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
thrash th=new thrash();
String pre;
Random random=new Random();
String in=jTextPane2.getText();
char [] input=in.toCharArray();
for(int i=0;i<input.length;i++){
char temp=input[i];
//for string
if( (temp>='a' && temp<='z') || (temp>='A' && temp<='Z')){
if(temp>='a' && temp<='z'){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+th.stringcase[0][(random.nextInt(4))]);
temp=Character.toUpperCase(temp);
}
else if(temp>='A' && temp<='Z'){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+th.stringcase[1][(random.nextInt(4))]);
}
int sum=0;
int set=random.nextInt(6);
for(int j=0;j<26;j++){
if(temp==th.alpha[j]){
sum=th.alphai[(set)][j];
}}
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+th.sett[(set)]);
for(int j=0;j<5;j++){
int c=random.nextInt(9);
sum=sum-c;
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+c);
}
if((sum>9 && sum<99) || (sum<-9 && sum>-99)){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"y");
}
else{
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"z");
}
if(sum<0){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"m"+(-(sum)));
}
else {
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"n"+sum);
}
}
//for space
else if(temp==' '){
int sum=random.nextInt(99);
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+(th.stringcase[2][random.nextInt(5)]));
pre=jTextPane1.getText();
jTextPane1.setText(pre+""+(th.sett[(random.nextInt(6))]));
for(int j=0;j<5;j++){
int c=random.nextInt(9);
sum=sum-c;
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+c);
}
if((sum>9 && sum<99) || (sum<-9 && sum>-99)){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"y");
}
else{
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"z");
}
if(sum<0){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"m"+(-(sum)));
}
else {
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"n"+sum);
}
}
//for numbers
else if(temp>='0' && temp<='9'){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+(th.stringcase[3][random.nextInt(5)]));
int sum=0;
int set=random.nextInt(6);
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+th.sett[(set)]);
for(int j=0;j<=9;j++){
sum=th.numri[(set)][(Character.getNumericValue(temp))];
}
for(int j=0;j<5;j++){
int c=random.nextInt(9);
sum=sum-c;
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+c);
}
if((sum>9 && sum<99) || (sum<-9 && sum>-99)){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"y");
}
else{
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"z");
}
if(sum<0){
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"m"+(-(sum)));
}
else {
pre=jTextPane1.getText();
jTextPane1.setText(""+pre+""+"n"+sum);
}
}
}
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
jTextPane1.setText("");
}
ME S S A G E _ d e c r y p t I o n . j a v a
package encryption;
import javax.swing.JFrame;
import java.util.Random;
import javax.swing.JOptionPane;
public class Message_Decryption extends javax.swing.JFrame{
private void formWindowOpened(java.awt.event.WindowEvent evt) {
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
jLabel1.setHorizontalAlignment(jLabel1.CENTER);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
thrash th=new thrash();
String pre;
String cod=jTextPane2.getText();
char[] code=cod.toCharArray();
int stringcase=-1;
int set=-1;
for(int i=0;i<code.length;){
for(int j=i;j<(i+9);j++){
for(int k=0;k<4;k++){
for(int h=0;h<5;h++){
if(code[j]==th.stringcase[k][h]) {
stringcase=k;
}
}
}
j++;
for(int k=0;k<7;k++){
if(code[j]==th.sett[k]){
set=k;
}
}
j++;
//lower case
if(stringcase==0){
int ch=-1;
int sum=0;
for(int num_sum=j;num_sum<(j+5);num_sum++){
sum=sum+Character.getNumericValue(code[num_sum]);
}
j=j+5;
if(code[(j+1)]=='m'){
if(code[j]=='y'){
++i;
int a=Character.getNumericValue(code[j+2]);
int b=Character.getNumericValue(code[j+3]);
int c=(a*10)+b;
sum=sum-c;
}
else{
int a=Character.getNumericValue(code[j+2]);
sum=sum-a;
}
}
else if(code[(j+1)]=='n'){
if(code[j]=='y'){
++i;
int a=Character.getNumericValue(code[j+2]);
int b=Character.getNumericValue(code[j+3]);
int c=(a*10)+b;
sum=sum+c;
}
else{
int a=Character.getNumericValue(code[j+2]);
sum=sum+a;
}
}
for(int k=0;k<26;k++){
if(sum==th.alphai[set][k]){
ch=k;
}
}
pre=jTextPane1.getText();
jTextPane1.setText(pre+""+Character.toLowerCase(th.alpha[ch]) );
break;
}
//Upper case
else if(stringcase==1){
pre=jTextPane1.getText();//
int ch=-1;
int sum=0;
for(int num_sum=j;num_sum<(j+5);num_sum++){
sum=sum+Character.getNumericValue(code[num_sum]);
}
j=j+5;
if(code[(j+1)]=='m'){
if(code[j]=='y'){
++i;
int a=Character.getNumericValue(code[j+2]);
int b=Character.getNumericValue(code[j+3]);
int c=(a*10)+b;
sum=sum-c;
}
else{
int a=Character.getNumericValue(code[j+2]);
sum=sum-a;
}
}
else if(code[(j+1)]=='n'){
if(code[j]=='y'){
++i;
int a=Character.getNumericValue(code[j+2]);
int b=Character.getNumericValue(code[j+3]);
int c=(a*10)+b;
sum=sum+c;
}
else{
int a=Character.getNumericValue(code[j+2]);
sum=sum+a;
}
}
for(int k=0;k<26;k++){
if(sum==th.alphai[set][k]){
ch=k;
}
}
pre=jTextPane1.getText();
jTextPane1.setText(pre+""+Character.toUpperCase(th.alpha[ch]) );
break;
}
//space
else if(stringcase==2){
pre=jTextPane1.getText();
jTextPane1.setText(pre+""+" ");
if(code[(i+7)]=='y'){
i++;
}
break;
}
//number
else if(stringcase==3){
int ch=-1;
int sum=0;
for(int num_sum=j;num_sum<(j+5);num_sum++){
sum=sum+Character.getNumericValue(code[num_sum]);
}
j=j+5;
if(code[(j+1)]=='m'){
if(code[j]=='y'){
++i;
int a=Character.getNumericValue(code[j+2]);
int b=Character.getNumericValue(code[j+3]);
int c=(a*10)+b;
sum=sum-c;
}
else{
int a=Character.getNumericValue(code[j+2]);
sum=sum-a;
}
}
else if(code[(j+1)]=='n'){
if(code[j]=='y'){
++i;
int a=Character.getNumericValue(code[j+2]);
int b=Character.getNumericValue(code[j+3]);
int c=(a*10)+b;
sum=sum+c;
}
else{
int a=Character.getNumericValue(code[j+2]);
sum=sum+a;
}
}
for(int k=0;k<10;k++){
if(sum==th.numri[set][k]){
ch=k;
}
}
pre=jTextPane1.getText();
jTextPane1.setText(pre+""+ch);
break;}}
i+=10;}}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
jTextPane1.setText("");
}
M a n u a l R e p r e s e n t a t I o n
• First it will check the case of char
1. Lower case = Print random character from stringcase of index [0][_]
2. Upper case = Print random character from stringcase of index [1][_]
3. Space = Print random character from stringcase of index [2][_]
4. Number = Print random character from stringcase of index [3][_]
• Then code will assign a random set of 0 to 7
• Print sign of set according to set index from sett[]
• Then it will select the index from alpha according to char
• Then using set and alpha index fetch sum from alphai or from numri
• Then code will divide sum into 6 parts and the sum of all 6 is equal to the no. fetched
by the code
• First 5 no. are under 9 and last no. can be between -99 to 99
• Then code will print first 5 numbers
• Then code will check condition of 6th
no.
1. If number is of 2 digit it will print “y” else “z”
2. If number is negative then code will print m else n
Example:
Algorithm Output
If char = ‘b’;
‘a’ is Lower case letter then code will print
any char from stringcase[0][_]
a
Random choose no 0-7 and print sett using chosen no.
as index
a!
Using Linear Search find out the index of char in alpha
From index and set fetch the value of sum from alphai
Random print 5 no. (0-9) a!58019
Then will find out the difference of sum of 5nos and the
sum fetched by the code from alphai
If no. is of 2 digit the print y else z a!58019z
If 6th
no. is negative then print m else n a!58019zm
If no. is negative then convert into positive and print a!58019zm2

More Related Content

What's hot

Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and Analysis
Wiwat Ruengmee
 
Preparing Java 7 Certifications
Preparing Java 7 CertificationsPreparing Java 7 Certifications
Preparing Java 7 Certifications
Giacomo Veneri
 
Exceptional exceptions
Exceptional exceptionsExceptional exceptions
Exceptional exceptions
Llewellyn Falco
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
Padmanaban Kalyanaraman
 
Java script obfuscation
Java script obfuscationJava script obfuscation
Java script obfuscation
n|u - The Open Security Community
 
Array&amp;string
Array&amp;stringArray&amp;string
Array&amp;string
chanchal ghosh
 
The Ring programming language version 1.5 book - Part 6 of 31
The Ring programming language version 1.5 book - Part 6 of 31The Ring programming language version 1.5 book - Part 6 of 31
The Ring programming language version 1.5 book - Part 6 of 31
Mahmoud Samir Fayed
 
System Verilog (Tutorial -- 2X1 Multiplexer)
System Verilog (Tutorial -- 2X1 Multiplexer)System Verilog (Tutorial -- 2X1 Multiplexer)
System Verilog (Tutorial -- 2X1 Multiplexer)
Denise Wilson
 
System Verilog (Tutorial -- 4X1 Multiplexer)
System Verilog (Tutorial -- 4X1 Multiplexer)System Verilog (Tutorial -- 4X1 Multiplexer)
System Verilog (Tutorial -- 4X1 Multiplexer)
Denise Wilson
 
Review questions and answers
Review questions and answersReview questions and answers
Review questions and answers
IIUM
 
Mit6 087 iap10_lec02
Mit6 087 iap10_lec02Mit6 087 iap10_lec02
Mit6 087 iap10_lec02
John Lawrence
 
Simple Scala DSLs
Simple Scala DSLsSimple Scala DSLs
Simple Scala DSLs
linxbetter
 
Random stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbenchRandom stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbench
Kashyap Adodariya
 
C tutorial
C tutorialC tutorial
Lecture 7 arrays
Lecture   7 arraysLecture   7 arrays
Lecture 7 arrays
manish kumar
 
Writing clean code
Writing clean codeWriting clean code
Writing clean code
Angel Garcia Olloqui
 
Clean Code Development
Clean Code DevelopmentClean Code Development
Clean Code Development
Peter Gfader
 
09 Methods
09 Methods09 Methods
09 Methods
maznabili
 
Javascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionJavascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introduction
Iban Martinez
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
siddharthjha34
 

What's hot (20)

Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and Analysis
 
Preparing Java 7 Certifications
Preparing Java 7 CertificationsPreparing Java 7 Certifications
Preparing Java 7 Certifications
 
Exceptional exceptions
Exceptional exceptionsExceptional exceptions
Exceptional exceptions
 
Data Flow Modeling
Data Flow ModelingData Flow Modeling
Data Flow Modeling
 
Java script obfuscation
Java script obfuscationJava script obfuscation
Java script obfuscation
 
Array&amp;string
Array&amp;stringArray&amp;string
Array&amp;string
 
The Ring programming language version 1.5 book - Part 6 of 31
The Ring programming language version 1.5 book - Part 6 of 31The Ring programming language version 1.5 book - Part 6 of 31
The Ring programming language version 1.5 book - Part 6 of 31
 
System Verilog (Tutorial -- 2X1 Multiplexer)
System Verilog (Tutorial -- 2X1 Multiplexer)System Verilog (Tutorial -- 2X1 Multiplexer)
System Verilog (Tutorial -- 2X1 Multiplexer)
 
System Verilog (Tutorial -- 4X1 Multiplexer)
System Verilog (Tutorial -- 4X1 Multiplexer)System Verilog (Tutorial -- 4X1 Multiplexer)
System Verilog (Tutorial -- 4X1 Multiplexer)
 
Review questions and answers
Review questions and answersReview questions and answers
Review questions and answers
 
Mit6 087 iap10_lec02
Mit6 087 iap10_lec02Mit6 087 iap10_lec02
Mit6 087 iap10_lec02
 
Simple Scala DSLs
Simple Scala DSLsSimple Scala DSLs
Simple Scala DSLs
 
Random stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbenchRandom stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbench
 
C tutorial
C tutorialC tutorial
C tutorial
 
Lecture 7 arrays
Lecture   7 arraysLecture   7 arrays
Lecture 7 arrays
 
Writing clean code
Writing clean codeWriting clean code
Writing clean code
 
Clean Code Development
Clean Code DevelopmentClean Code Development
Clean Code Development
 
09 Methods
09 Methods09 Methods
09 Methods
 
Javascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introductionJavascript & jQuery: A pragmatic introduction
Javascript & jQuery: A pragmatic introduction
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 

Similar to Encryption Decryption Java Project by Devansh Koolwal

Computer java programs
Computer java programsComputer java programs
Computer java programs
ADITYA BHARTI
 
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdfIT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
DhanuskarSankar1
 
core java
 core java core java
core java
dssreenath
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or not
aluavi
 
Write a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdfWrite a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdf
arjunenterprises1978
 
Chapter 4.4
Chapter 4.4Chapter 4.4
Chapter 4.4
sotlsoc
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
anupamfootwear
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
Abner Chih Yi Huang
 
3. chapter ii
3. chapter ii3. chapter ii
3. chapter ii
Chhom Karath
 
Lecture 2 java.pdf
Lecture 2 java.pdfLecture 2 java.pdf
Lecture 2 java.pdf
SantoshSurwade2
 
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfAll based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
aroraenterprisesmbd
 
Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시
Junha Jang
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Ayes Chinmay
 
Java language fundamentals
Java language fundamentalsJava language fundamentals
Java language fundamentals
Kapish Joshi
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory
archana singh
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Sonu62614
 
Java Programming Below are the lexer token and shank file.pdf
Java Programming Below are the lexer token and shank file.pdfJava Programming Below are the lexer token and shank file.pdf
Java Programming Below are the lexer token and shank file.pdf
adinathassociates
 
C++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdfC++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdf
Rahul04August
 
Network security
Network securityNetwork security
Network security
babyangle
 

Similar to Encryption Decryption Java Project by Devansh Koolwal (20)

Computer java programs
Computer java programsComputer java programs
Computer java programs
 
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdfIT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
 
core java
 core java core java
core java
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or not
 
Write a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdfWrite a program Grader that that will be used by a program driver to.pdf
Write a program Grader that that will be used by a program driver to.pdf
 
Chapter 4.4
Chapter 4.4Chapter 4.4
Chapter 4.4
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
3. chapter ii
3. chapter ii3. chapter ii
3. chapter ii
 
Lecture 2 java.pdf
Lecture 2 java.pdfLecture 2 java.pdf
Lecture 2 java.pdf
 
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfAll based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
 
Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 
Java language fundamentals
Java language fundamentalsJava language fundamentals
Java language fundamentals
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory
 
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docxShad_Cryptography_PracticalFile_IT_4th_Year (1).docx
Shad_Cryptography_PracticalFile_IT_4th_Year (1).docx
 
Java Programming Below are the lexer token and shank file.pdf
Java Programming Below are the lexer token and shank file.pdfJava Programming Below are the lexer token and shank file.pdf
Java Programming Below are the lexer token and shank file.pdf
 
C++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdfC++ Searching & Sorting5. Sort the following list using the select.pdf
C++ Searching & Sorting5. Sort the following list using the select.pdf
 
Network security
Network securityNetwork security
Network security
 

Recently uploaded

学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 

Recently uploaded (20)

学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 

Encryption Decryption Java Project by Devansh Koolwal

  • 1. W E M A D E I T ! Akhil Yadav - ENG18CA0008 Devansh Koolwal - ENG18CA0014 BCA-2nd JAVA PROJECT Encryption Decryption Dayananda Sagar University
  • 2. T h r a s h . j a v a package encryption.java; public class thrash { char[] alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); int[][] alphai={ {42,43,75,76,24,85,68,80,79,82,55,61,26,56,91,28,89,92,19,23,88,87,96,14,52,58}, {81,21,38,72,55,56,69,25,30,88,82,24,34,10,57,79,77,94,18,76,20,98,16,66,40,95}, {31,89,23,17,81,25,63,60,93,75,32,77,19,41,66,20,45,47,65,33,99,29,52,72,76,80}, {10,79,54,59,18,32,38,16,12,71,99,85,34,36,31,17,87,82,94,88,46,93,89,51,13,44}, {29,70,49,52,10,65,44,64,35,39,96,55,17,26,98,75,11,16,21,19,31,15,71,69,81,30}, {87,18,54,62,57,60,83,76,44,91,84,16,69,97,93,51,58,94,98,59,15,61,42,65,81,70}, {31,45,67,79,63,35,53,42,32,77,51,27,90,70,78,14,84,73,37,10,54,95,62,81,22,66} }; //alphai represents 7 sets of character in numeric form int [][] numri={ {42,43,75,76,24,85,68,80,79,82}, {81,21,38,72,55,56,69,25,30,88}, {31,89,23,17,81,25,63,60,93,75}, {10,79,54,59,16,31,38,16,12,71}, {29,70,39,52,10,65,64,64,35,39}, {87,18,58,60,51,60,83,76,44,92}, {34,45,67,79,63,37,53,42,34,77}, {78,37,77,12,91,91,36,87,15,52}}; //numri represents 7 sets of Numbers
  • 3. char [][] stringcase={{'a','c','n','l','o'},{'y','u','r','d','q',},{'s','i','z','w','x'},{'b','e','f','h','j'}}; //stringcase[0][_] - lowercase //stringcase[1][_] - Uppercase //stringcase[2][_] - space //stringcase[3][_] - number char[] sett={'@','!','"',']','+','%','#'}; //sett represents set index }
  • 4. M e s s a g e _ E n c r y p t I o n . j a v a package encryption; import javax.swing.JFrame; import java.util.Random; import javax.swing.JOptionPane; public class Message_Encryption extends javax.swing.JFrame{ private void formWindowOpened(java.awt.event.WindowEvent evt) { this.setExtendedState(JFrame.MAXIMIZED_BOTH); this.setVisible(true); jLabel1.setHorizontalAlignment(jLabel1.CENTER); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { thrash th=new thrash(); String pre; Random random=new Random(); String in=jTextPane2.getText(); char [] input=in.toCharArray(); for(int i=0;i<input.length;i++){ char temp=input[i];
  • 5. //for string if( (temp>='a' && temp<='z') || (temp>='A' && temp<='Z')){ if(temp>='a' && temp<='z'){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+th.stringcase[0][(random.nextInt(4))]); temp=Character.toUpperCase(temp); } else if(temp>='A' && temp<='Z'){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+th.stringcase[1][(random.nextInt(4))]); } int sum=0; int set=random.nextInt(6); for(int j=0;j<26;j++){ if(temp==th.alpha[j]){ sum=th.alphai[(set)][j]; }} pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+th.sett[(set)]); for(int j=0;j<5;j++){ int c=random.nextInt(9); sum=sum-c; pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+c); }
  • 6. if((sum>9 && sum<99) || (sum<-9 && sum>-99)){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"y"); } else{ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"z"); } if(sum<0){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"m"+(-(sum))); } else { pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"n"+sum); } } //for space else if(temp==' '){ int sum=random.nextInt(99); pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+(th.stringcase[2][random.nextInt(5)])); pre=jTextPane1.getText(); jTextPane1.setText(pre+""+(th.sett[(random.nextInt(6))])); for(int j=0;j<5;j++){ int c=random.nextInt(9);
  • 7. sum=sum-c; pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+c); } if((sum>9 && sum<99) || (sum<-9 && sum>-99)){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"y"); } else{ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"z"); } if(sum<0){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"m"+(-(sum))); } else { pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"n"+sum); } } //for numbers else if(temp>='0' && temp<='9'){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+(th.stringcase[3][random.nextInt(5)])); int sum=0;
  • 8. int set=random.nextInt(6); pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+th.sett[(set)]); for(int j=0;j<=9;j++){ sum=th.numri[(set)][(Character.getNumericValue(temp))]; } for(int j=0;j<5;j++){ int c=random.nextInt(9); sum=sum-c; pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+c); } if((sum>9 && sum<99) || (sum<-9 && sum>-99)){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"y"); } else{ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"z"); } if(sum<0){ pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"m"+(-(sum)));
  • 9. } else { pre=jTextPane1.getText(); jTextPane1.setText(""+pre+""+"n"+sum); } } } } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { jTextPane1.setText(""); }
  • 10. ME S S A G E _ d e c r y p t I o n . j a v a package encryption; import javax.swing.JFrame; import java.util.Random; import javax.swing.JOptionPane; public class Message_Decryption extends javax.swing.JFrame{ private void formWindowOpened(java.awt.event.WindowEvent evt) { this.setExtendedState(JFrame.MAXIMIZED_BOTH); this.setVisible(true); jLabel1.setHorizontalAlignment(jLabel1.CENTER); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { thrash th=new thrash(); String pre; String cod=jTextPane2.getText(); char[] code=cod.toCharArray(); int stringcase=-1; int set=-1; for(int i=0;i<code.length;){ for(int j=i;j<(i+9);j++){ for(int k=0;k<4;k++){ for(int h=0;h<5;h++){ if(code[j]==th.stringcase[k][h]) {
  • 11. stringcase=k; } } } j++; for(int k=0;k<7;k++){ if(code[j]==th.sett[k]){ set=k; } } j++; //lower case if(stringcase==0){ int ch=-1; int sum=0; for(int num_sum=j;num_sum<(j+5);num_sum++){ sum=sum+Character.getNumericValue(code[num_sum]); } j=j+5; if(code[(j+1)]=='m'){ if(code[j]=='y'){ ++i; int a=Character.getNumericValue(code[j+2]); int b=Character.getNumericValue(code[j+3]);
  • 12. int c=(a*10)+b; sum=sum-c; } else{ int a=Character.getNumericValue(code[j+2]); sum=sum-a; } } else if(code[(j+1)]=='n'){ if(code[j]=='y'){ ++i; int a=Character.getNumericValue(code[j+2]); int b=Character.getNumericValue(code[j+3]); int c=(a*10)+b; sum=sum+c; } else{ int a=Character.getNumericValue(code[j+2]); sum=sum+a; } } for(int k=0;k<26;k++){ if(sum==th.alphai[set][k]){
  • 13. ch=k; } } pre=jTextPane1.getText(); jTextPane1.setText(pre+""+Character.toLowerCase(th.alpha[ch]) ); break; } //Upper case else if(stringcase==1){ pre=jTextPane1.getText();// int ch=-1; int sum=0; for(int num_sum=j;num_sum<(j+5);num_sum++){ sum=sum+Character.getNumericValue(code[num_sum]); } j=j+5; if(code[(j+1)]=='m'){ if(code[j]=='y'){ ++i; int a=Character.getNumericValue(code[j+2]); int b=Character.getNumericValue(code[j+3]); int c=(a*10)+b;
  • 14. sum=sum-c; } else{ int a=Character.getNumericValue(code[j+2]); sum=sum-a; } } else if(code[(j+1)]=='n'){ if(code[j]=='y'){ ++i; int a=Character.getNumericValue(code[j+2]); int b=Character.getNumericValue(code[j+3]); int c=(a*10)+b; sum=sum+c; } else{ int a=Character.getNumericValue(code[j+2]); sum=sum+a; } } for(int k=0;k<26;k++){ if(sum==th.alphai[set][k]){ ch=k; }
  • 15. } pre=jTextPane1.getText(); jTextPane1.setText(pre+""+Character.toUpperCase(th.alpha[ch]) ); break; } //space else if(stringcase==2){ pre=jTextPane1.getText(); jTextPane1.setText(pre+""+" "); if(code[(i+7)]=='y'){ i++; } break; } //number else if(stringcase==3){ int ch=-1; int sum=0; for(int num_sum=j;num_sum<(j+5);num_sum++){ sum=sum+Character.getNumericValue(code[num_sum]); } j=j+5;
  • 16. if(code[(j+1)]=='m'){ if(code[j]=='y'){ ++i; int a=Character.getNumericValue(code[j+2]); int b=Character.getNumericValue(code[j+3]); int c=(a*10)+b; sum=sum-c; } else{ int a=Character.getNumericValue(code[j+2]); sum=sum-a; } } else if(code[(j+1)]=='n'){ if(code[j]=='y'){ ++i; int a=Character.getNumericValue(code[j+2]); int b=Character.getNumericValue(code[j+3]); int c=(a*10)+b; sum=sum+c; } else{ int a=Character.getNumericValue(code[j+2]);
  • 18. M a n u a l R e p r e s e n t a t I o n • First it will check the case of char 1. Lower case = Print random character from stringcase of index [0][_] 2. Upper case = Print random character from stringcase of index [1][_] 3. Space = Print random character from stringcase of index [2][_] 4. Number = Print random character from stringcase of index [3][_] • Then code will assign a random set of 0 to 7 • Print sign of set according to set index from sett[] • Then it will select the index from alpha according to char • Then using set and alpha index fetch sum from alphai or from numri • Then code will divide sum into 6 parts and the sum of all 6 is equal to the no. fetched by the code • First 5 no. are under 9 and last no. can be between -99 to 99 • Then code will print first 5 numbers • Then code will check condition of 6th no. 1. If number is of 2 digit it will print “y” else “z” 2. If number is negative then code will print m else n Example: Algorithm Output If char = ‘b’; ‘a’ is Lower case letter then code will print any char from stringcase[0][_] a Random choose no 0-7 and print sett using chosen no. as index a! Using Linear Search find out the index of char in alpha From index and set fetch the value of sum from alphai Random print 5 no. (0-9) a!58019 Then will find out the difference of sum of 5nos and the sum fetched by the code from alphai If no. is of 2 digit the print y else z a!58019z If 6th no. is negative then print m else n a!58019zm If no. is negative then convert into positive and print a!58019zm2