Submit Search
Upload
8606 ins prac 1.docx
•
Download as DOCX, PDF
•
0 likes
•
8 views
K
KhushalChoudhary14
Follow
ins sem 6 pillais college
Read less
Read more
Data & Analytics
Report
Share
Report
Share
1 of 5
Download now
Recommended
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
DhanuskarSankar1
String
String
SANTOSH RATH
Asssignment2
Asssignment2
AnnamalikAnnamalik
Network security
Network security
babyangle
IT6712 lab manual
IT6712 lab manual
Madhu Amarnath
Circular queue
Circular queue
ShobhaHiremath8
5 1. character processing
5 1. character processing
웅식 전
Writing Parsers in Python using Pyparsing
Writing Parsers in Python using Pyparsing
ptmcg
Recommended
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
IT8761-SECURITY LABORATORY-590519304-IT8761 security labmanual.pdf
DhanuskarSankar1
String
String
SANTOSH RATH
Asssignment2
Asssignment2
AnnamalikAnnamalik
Network security
Network security
babyangle
IT6712 lab manual
IT6712 lab manual
Madhu Amarnath
Circular queue
Circular queue
ShobhaHiremath8
5 1. character processing
5 1. character processing
웅식 전
Writing Parsers in Python using Pyparsing
Writing Parsers in Python using Pyparsing
ptmcg
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
shettysachin2005
#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx
gertrudebellgrove
Data Structures Using C Practical File
Data Structures Using C Practical File
Rahul Chugh
Data structure
Data structure
Markustec
VTU Data Structures Lab Manual
VTU Data Structures Lab Manual
Nithin Kumar,VVCE, Mysuru
Programing with java for begniers .pptx
Programing with java for begniers .pptx
adityaraj7711
#include stdio.h #include stdlib.h #include unistd.h #in.pdf
#include stdio.h #include stdlib.h #include unistd.h #in.pdf
contact34
Microsoft Word Hw#1
Microsoft Word Hw#1
kkkseld
C programms
C programms
Mukund Gandrakota
C lab manaual
C lab manaual
manoj11manu
Add a 3rd field help that contains a short help string for each of t.pdf
Add a 3rd field help that contains a short help string for each of t.pdf
info245627
Help with this substitution program- line 3 of the output is different.pdf
Help with this substitution program- line 3 of the output is different.pdf
gaurav444u
L13 string handling(string class)
L13 string handling(string class)
teach4uin
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013
ericupnorth
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
fulawalesam
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
shivangimorya083
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
Delhi Call girls
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
firstjob4
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
More Related Content
Similar to 8606 ins prac 1.docx
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
shettysachin2005
#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx
gertrudebellgrove
Data Structures Using C Practical File
Data Structures Using C Practical File
Rahul Chugh
Data structure
Data structure
Markustec
VTU Data Structures Lab Manual
VTU Data Structures Lab Manual
Nithin Kumar,VVCE, Mysuru
Programing with java for begniers .pptx
Programing with java for begniers .pptx
adityaraj7711
#include stdio.h #include stdlib.h #include unistd.h #in.pdf
#include stdio.h #include stdlib.h #include unistd.h #in.pdf
contact34
Microsoft Word Hw#1
Microsoft Word Hw#1
kkkseld
C programms
C programms
Mukund Gandrakota
C lab manaual
C lab manaual
manoj11manu
Add a 3rd field help that contains a short help string for each of t.pdf
Add a 3rd field help that contains a short help string for each of t.pdf
info245627
Help with this substitution program- line 3 of the output is different.pdf
Help with this substitution program- line 3 of the output is different.pdf
gaurav444u
L13 string handling(string class)
L13 string handling(string class)
teach4uin
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013
ericupnorth
Similar to 8606 ins prac 1.docx
(14)
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
import java.util.ArrayList; import java.util.Scanner;public clas.pdf
#include String.hpp#include ..Functionsfunctions.hpp.docx
#include String.hpp#include ..Functionsfunctions.hpp.docx
Data Structures Using C Practical File
Data Structures Using C Practical File
Data structure
Data structure
VTU Data Structures Lab Manual
VTU Data Structures Lab Manual
Programing with java for begniers .pptx
Programing with java for begniers .pptx
#include stdio.h #include stdlib.h #include unistd.h #in.pdf
#include stdio.h #include stdlib.h #include unistd.h #in.pdf
Microsoft Word Hw#1
Microsoft Word Hw#1
C programms
C programms
C lab manaual
C lab manaual
Add a 3rd field help that contains a short help string for each of t.pdf
Add a 3rd field help that contains a short help string for each of t.pdf
Help with this substitution program- line 3 of the output is different.pdf
Help with this substitution program- line 3 of the output is different.pdf
L13 string handling(string class)
L13 string handling(string class)
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013
Recently uploaded
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
fulawalesam
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
shivangimorya083
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
Delhi Call girls
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
firstjob4
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
olyaivanovalion
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
olyaivanovalion
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
shambhavirathore45
Halmar dropshipping via API with DroFx
Halmar dropshipping via API with DroFx
olyaivanovalion
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data 2023
ymrp368
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Delhi Call girls
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
JohnnyPlasten
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
Dr. Soumendra Kumar Patra
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
michael115558
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Delhi Call girls
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
Lars Albertsson
Recently uploaded
(20)
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Zuja dropshipping via API with DroFx.pptx
Zuja dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
Halmar dropshipping via API with DroFx
Halmar dropshipping via API with DroFx
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data 2023
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
8606 ins prac 1.docx
1.
[Type here] [Type
here] Khushal Choudhary 8606 PRACTICAL NO. 1 Aim: Implementing Substitution Ciphers a) Caesar Cipher Code: // Practical 1 A import java.util.Scanner; public class practical1a { int total_alphabets=26,key=3; String encrypted=" ",decrypted=" "; char ch; public String encrypt (String plain) { for(int i=0;i<plain.length();i++) { ch=plain.charAt(i); if(ch==' ') encrypted+="-"; else if(ch>='A' && ch<='Z') { if(ch<='Z'-key) { encrypted+=String.valueOf((char)(ch+key)); } else { encrypted+=String.valueOf((char)(ch- (total_alphabetskey))); } } else { encrypted+=String.valueOf(ch); } } return encrypted; } public String decrypt (String cipher) { for(int i=0;i<cipher.length();i++) { ch=cipher.charAt(i); if(ch==' ') decrypted+="-"; else if(ch>='A' && ch<='Z') { if(ch>='A'+key) {
2.
[Type here] [Type
here] Khushal Choudhary 8606 decrypted+=String.valueOf((char)(ch-key)); } else { decrypted+=String.valueOf((char)(ch+(total_alphabetskey))); } } else { decrypted+=String.valueOf(ch); } } return decrypted; } public static void main(String[] args) { String plaintext, ciphertext; practical1a cc= new practical1a(); System.out.println("Enter text"); plaintext=new Scanner(System.in).nextLine().toUpperCase(); ciphertext=cc.encrypt(plaintext); System.out.println("Encrypted text="+ciphertext); plaintext=cc.decrypt(ciphertext); System.out.println("Decrypted text="+plaintext); } } Output: Modified Caesar Cipher Code:
3.
[Type here] [Type
here] Khushal Choudhary 8606 } } else { decrypted+=String.valueOf(ch); } } return decrypted; } public static void main(String[] args) { String plaintext, ciphertext; int key; practical1b cc= new practical1b(); System.out.println("Enter text"); plaintext=new Scanner(System.in).nextLine().toUpperCase(); System.out.println("Enter key "); key=new Scanner(System.in).nextInt(); ciphertext=cc.encrypt(plaintext,key); System.out.println("Encrypted text="+ciphertext); plaintext=cc.decrypt(ciphertext,key); System.out.println("Decrypted text="+plaintext); } } Output: Monoalphabetic
4.
[Type here] [Type
here] Khushal Choudhary 8606 Code: } Output: d) Poly-Alphabetic Code: import java.util.*; public class Poly { public static void main(String[]args) { String plaintext="HOWAREYOU"; String secretkey="HELLOHELL"; System.out.println("Plain text before encryption:"+plaintext); String encryptedtext=encrypt(plaintext,secretkey); System.out.println("Encrypted text after encryption:"+encryptedtext); String decryptedtext=decrypt(encryptedtext,secretkey); System.out.println("Decrypted text after decryption:"+decryptedtext); } private static String encrypt(String plaintext, String secretkey) { StringBuffer encryptedString=new StringBuffer(); int encryptedInt; for(int i=0;i<plaintext.length();i++) { int plaintextInt=(int)(plaintext.charAt(i)); int secretkeyInt=(int)(secretkey.charAt(i)); encryptedInt=(plaintextInt+secretkeyInt)%26; encryptedString.append((char)((encryptedInt)+(int)'A')); } return encryptedString.toString(); } private static String decrypt(String decryptedtext, String secretkey) {
5.
[Type here] [Type
here] Khushal Choudhary 8606 StringBuffer decryptedString=new StringBuffer(); int decryptedInt; for(int i=0;i<decryptedtext.length();i++) { int decryptedtextInt=(int)(decryptedtext.charAt(i)); int secretkeyInt=(int)(secretkey.charAt(i)); decryptedInt=decryptedtextInt-secretkeyInt; if(decryptedInt<0) Output:
Download now