You are on page 1of 36
computer engg Practical No.1(A) Almm:- Install and configure antivirus software on system, Requirements:- ‘+ Computer sytem with i Intl processor having 8 GE RAM and 1 TE Hard-isk © Quick heal ancvins + Operating sytem= Windows Steps for i + Ifyou purchase the anivis program from a real stor, inset the CD or DVD int the computers dae drive, The installation process should start sutomaticly, wth a windows ‘pening to help guide you trough the instal proces, you downloaded the antivirus program onthe Internet, find the downloaded file on your computer, Ifthe dowloaded file is 4 zip file, zip the Tle to extrat aa access the installtion files, Look for a fle named setup.exe, instalenc, oF something simi, then double-click that file, The installation proves shoul start, with a window opening to help guide you trough the instal roees Inthe installation proccss window, fllow the steps provided! to install the antivirus program, The install process provises recommended options so the antivirus program wl function properly hich in most etscs can be aovepted asi. The one exception is ifthe incall process recommends to install any toolbars for Internet browsers or other helpful programs Tor your compute. I pronpied to install other software with the antvini program, uncheck all boxes or desine the ial of those extra programs, No adional program shouldbe needed forthe anvinis program to instal and min suecessflly on Your computer ‘When the instal proces is complete, closeout ofthe install window. used, remove the CD or DVD om the computers dsc drive Conclusi tn this practical we study about how o install and configure an antvius on system Practical 1(B) Alm: - Set up operating system update, Requirements: + Computer sytem with i Intel processor having 8 GB RAM and 1 TB Harddisk @ 26 4 Q programs for your computer, If prompted to snsall other software with the antivirus program, uncheck all boxes or desine the instal of those extra programs, No additional programs should be needed for the antivirus progtam to instal and run suecessflly on {our computer. + Whon the instal process is complete, else out ofthe install window + fused, remove the CD o¢ DVD trom the computer dse drive, In this practical we sty about howto install and configure an antivins on system Practical 1(B) Aim: - Set up operating system update. Requirements: ‘Computer sytem with i Intl processor having § GE RAM and 1 TB Harddisk + Oporting sytem Windows ‘Steps for set up operating system update: ‘Open Windows Update by clicking the Start button inthe lwrer-left corner. In the search| box. type Update, and then, in the ist of resus, lick either Windows Update or Check forupdates Click the Check for updates buton and then wait while Windows looks for the latest Updates for your computer If you see a message telling you that important updetes are availabe, or telling you to review important updates, click the message to view and selec the important updates to ‘dovnload o install In the list, click the imponant updates far more information, Select the checkboxes for sy updates that you want to instal, and hen click OK (Click tstll updates Conclusion Antivirus programs help prevent viruses and spyware from infecting a computer and therefore are one of the essential software programs each computer should have running at all simes. There are thousands of viruses and spyware on the Internet, and any one of them can cause damage to personal sor the computer's operating system, PRACTICAL NO:- 2" Perform the backup and restore system PRACTICAL NO:- 28” Perform the backup and restore system Requirements:= = Computer system with i ltl processor having 8 GB RAM snd 1 TB Hardlisk Operating system Windows Steps for Backup on windows 10: + Back up ‘Thor are several ways to back up your PC. 1. Solest the Start button, then selost Control Panel > System and Maintenance ~ Backup and Restore 2, Doone othe following + youve never used Windows Backup befor or recently upgraded your version of Windows, solect Set ap backup. and thn follow the steps in the vzar you've created a backup before, you can wit for your regulary scheduled backup to occur or you can manually create a new backup by selecting Back ‘pow. you've erated « backup before, but want 10 make a new, fll backup rather than updating the Okl one, select Create new, fall backup, and then follow the steps in the wizard Steps for Restore on windows 10: you're missing an important ile or folder that you've hacks wp, here's how to gt it back tn the searchbox on the taskbar, type restore files, and then select Restore your files with File History Look forthe fle you nocd, tho se the arows to se alts versions. ‘When you ind the version you want, clot Restore to save iin ts original location. To save it ina dierent place right-click Restore, sloct Restore to, and then ehoose a new location 4. Find your backups erated on previous versions of Windows 5. IF you used Backup and Restore to ack up files or erate system image backups in previous ‘versions of Windus, your old backup is sill vaable in Windows 10. In the search bo onthe sn and Ser 1e4 History 2. Look forthe ile you need, then use the rows to soe alts versions 3. When you find the version you want, selet Restore to save it init orginal locaton. To save it ina diferent place, rit click Restor, select Restore to, and then choose a ne loestion, 4, Find your backup erated on previous versions of Windows 5. you used Backup and Restore to back up files or crete system image backups in previous ‘versions of Windows, your eld backup i sil avaiable in Windows 10. tn the searchbox onthe taskbar, type contol panel. Then select Contal Panel > System and Security Backup and Restore (Windows 7), Air you restore your somputer fom a system image backup, there may be rower versions of some of your files in ile backup thal you Want restore To restore files froma file backup that was created after the system image backup was created, follow these steps. Select the Start button, then select Control Panel > System and Malntenance "Backup and Restore Choose Seest another backup to restore es rom, BAF youre prompred for sn adiinistator passiord oF confirmation, type the passvord o7 provide confirmation, Jn Backup Perio, select the date range ofthe backup that contains the files that ‘you Want fo restore, and then follow the steps in the wizard Conclusion Tn this practial we Kent about how to perform backup and restore on Windows 10, Practical No.3 Aim: Setup Password tothe Operating System and Application Assuming you havent configured Windows to automatically lg in.chanes are you simpy dont have a passvord sel for your Windows account. You noo to correct this by erat a password right now ‘You can make one from Contol Pansl. Once you have, you must use it to log on ta a4 } Q ne Assuming you havent configured Windows to atomatclly login hanes are you simply dont have a passvord set for your Windows account. You noo to correct this by erating a passworight 0 ‘You can make one from Contol Panel. Once you have, you must use it 49 log on ta Windows from that point forward. That i unless you at some point remove your Windows pass od The specific steps you need fllow to create a Windows logon password difer somewhat depending on the operating system youre Using. See What Version of Windows Do I Have? it youte not sure which of those several Versions of Windows i stalled on your compute. Ie always a good idea to create a password reset disk afer erating a new password If your password seally complex and you don want to make reset disk, considr storing it ina password manager. Open Control Pans. The easiest way to do that in Windows 10 is by exccuting contol from the Start ment oe Run dialog box. tn Windows 8, use the Power set ‘Menu by pressing Win Select User Accounts (Windows 10) oF User Accounts and Family Safty (Windows 8). open User Accounts Choose Make changes to my account in PC setings. Select Sign-in options from the let Under the Password area, choose Add Enter the new password in the fis 0 tet Fels, You have todo i we to make sure you type the passwort comely Inthe Passwont in i. entr something that wil help you remember the password should you frgtit and then select Next, Hit Finish to complete the new password setup, ‘You can now exit out of any windows you opened to make the Passion, like Setings or PC stings 11:52 PS u\| @) 8 a) 6 10, You can now exit out of any windows you opened to make the Dssvond, like Setings or PC stings 41. Open Contrl Panel fom the Start menu 2. Select User Accounts and Family Safety (Windows 7) or User Accounts (Windows Vis. 3. Choose User Accounts 4 Inthe Make changes to your user account ates, sleet Create a password for your 5. Typerte password you want to use in the frst two text boxes 66 Entor something wsafl inthe Type a password hint textbox. This step is optional but we highly recomend that you use I you Togging i to Windows enter ‘he wrong password, this in wil popup, hopetlly jougng Your memory 7. Choose Create password t confirm your new password, £8. You can now close aut of any open windows Vou used to rach the page for changing the pasword 41, Navigate to Star > Control Panel 2, Choose Usee Accounts I youre inthe Category View of Cone Pane, youl ced to select it again on the next ore, 3, Solst your usemame inthe, oF pick an account a change ae 4, Choose the Create a password ink 5. nthe ist two textboxes, enter the password you would like to star using 6. Choose Create Password to confi your new password. 7. The next sroen might ask Do you want to make your fils and folders private? I other user aecourts willbe setup en this PC and youd like to keep your personal files private select Yes, Make Private. 1f youre not consemed about this kind of security oF this asount is the only account on your PC, you ean choose No {8 You can now close the User Asoounts window and tie Control Pane endow Security refers to providing a proestion system to computer system resources such as CPU, memory, disk, software programs and most importantly datairmation sored in the computer sytem. If computer program is run by an unathorzod user, then he'she may cause severe damsge ta computer or data stored i it. So a computer system rst be prolectod against unauthorized access, malicious aecess to system memory, Vues, Practical No. 4 Alm: Apply security to file folder or application using aecess permission and Steps to Assign File/Folder Permissions 1. Go to “Start Menu” > “Administrative Tools”, and click “Group Policy Management” to access its consol. In left pane! of “Group Policy Management Console” you have to cate © new Group Poliey Objector edit an existing Group Policy Object. To crete a new GPO, right cick “Group Policy Objects" and seeet “New” from the context men shows "New GPO" window @ 26 11:53 RUSCn 1. Go to "Star Menu” > “Administrative Tools”, and click “Group Policy “Management” to access its console In Ie panel of “Group Policy Management Console, you have @ erate & new Group Policy Object or edit an exiting Group Policy Objet. 3. To create a new GPO, right click "Group Policy Objects", and seeot "New" from the context men. shows “New GPO" windoot Name: ssigng Fader Pemissiond Source State GPO: Figure 1: Creating a new GPO 4. Ener name forthe Group Policy Object (GPO) in this casei is Assigning Folder Permissions) leave "Source Starter GPO" as "none 11:53, » Et » 6 S. Rightclick on the newly erated “User Folder Permissions” GPO, and select “Edit GPO" Group Policy Management Editor window appears onthe screen 6. Navigate to “Computer Configurtion” “Policies” “Windows Settings” > “Sceurigy Settings” > “File System” Figure 2: Navigate to File System 7. Right-click on “File System” in the let pane and scloct “AGM File.” H shows the following dishg bi Figure : Selet file or Folder which you want to assign permissions on S. Browse the folder or file thet you wish to assign permissions on, and lf click to saost i Click "OK 9. "Database Security window appears on the sera Figure 4: Database security window 10. Click “Advanced” button to access “Advanced Seewity Settings” window. Sty on the “Permissions” tb that appears by defaue Figure 5: Advanced security se 11. On this a, cthe sect an existing wer an elick “Et.” otic “AAA. toradda nev user to the permissions 12 "Permissions Entry for." dialog box opens up. Here, you will sce that ther is list of permissions available Tor your users, and you can also choose where You ‘vant o py those permissions, 14 5 ims | ee ATE on. ag [Reta suai eae 3] sososssncant jooooooonon§ Figure 6; Permissions enty fers Use the dropdown men in the “Apply to” field 10 assign selected peissions ty desired folders Chock the permissions as necded, These are self-explanatory Click “OK" to apply the permissions. It takes you back wo "Advanced Security” window Now, move tthe “Auditing” tab, Unde his ta, you ean do audit setings fo the fol, s0 that any change done to this folder or its permission willbe audited. Configure the ating stings as perrquiremest 11:53 RWS —- 50 that any change dont this Toler os psrmision will be audited. Conigus the asin stings as per requirement 17, Similarly, you can do ownership settings forthe folder under “Own 18. Once you have done “Permission”, “Aulting™ and “Ownership” setings, click “OK™ to else Advanced Security.” winds 19. Click "OK" to close “Database Security.” window. Nest, you will ce “Add Object” window es alae aga 1 Scepter pres ast ne © Spt mnie ty sasom aes ae Figure 7: Add object window 20, There re tree options on the “Add Objet” window 8, Configure this ile or folder then: Soles this option to apply the settings. 1 contsins| the following wo options. Propagate heritable permissions to all subfolders and fies: Sclectns tis option means, ll the subfolders an files will inert permissions rom the parent Fld. fa case of misttch o confit explicit permissions that 11:53, » 5B 9) 6 were assigned tthe subfolders or les will ovetide the intitad permissions. Replace existing permissions on all subfolders and_ es with inheritable permissions: This option will overwrite all he stings om all subfolders and Sle with fhe ones on the parent, so ulimately they will have kentical permissions to the parent folder. b. Do not allow permissions on this fle oF foldcr to be replascds Use this sting for subfolders and files that you do not want to inbent permissions. For this make an additional enty for those subfolders and es that will ot inher permissions eg Ie's fay You want the “A folder o inherit pension but don't want "Bolder to inherit emissions in that eas eeate an ete fr the “Bole 21.Close “Group Policy Management Bait” window 22. Right-click the domain you want to apply this GPO to, and then selet “Link an isting GPO. "option from the context men, "Seles GPO" Window opens up Figure 8: Selec the new GPO 23. Select the new “Assigning Folder Permissions" GPO, then click OK. 24.In the right pane, stay on the “Linked Group Policy Objects” tb that appears by dete. 25. Rishtlisk on the “Assigning Folder Permissions” and select “Enforced” from the ‘context men. A confirmation message appears on the seeen 2. Click “OK"to close the dialog bo. Conclusion: Assigning permissions foreach fle and folder individually cam be complex sn time consuming. To aid going through the annoyances of changing permissions fora thunh of fldes individually, se ean use Group Potey to doit In this arte, you wll the process of assigning file and folder permissions across « domain though GPO. These inaructons can be extremely helpful, an save your time if you have to asign permissions toa large numberof systems wih a common setup Practical No, Aim: Write a program to implement Caesar Cipher @ 26 @4 Practical No. Aim: Write a program to implement Caesar Cipher Introduction Algorithm of Caesar Cipher The algorithm of Caesar cipher hols the Following features — + Caesar Cipher Technique is the simple and casy- method of encryption ‘eohnique + is simple typeof substitution cipher. Each later of plaintext replaced by a letter with some fixed number of positions shown with alphabet The following diagram dspicte the working of Caesar cipher algorithm implementation ~ alse] {e]ojelFis|H} 1] Explanation The plaintext characteris traversed one a tine For each character in the given plaintext, transform the given character as pee the rule depending onthe procedue of enersption and decryption of text After the steps is followed a new siting is generted which is refed as cipher This algorithm consists oF afew features that are given below. « This wechniqueis quite simple to apply encryption. » Each tet is replaced by the Fixed numberof position oven orp with the alphabet. «Its simple typeof subsite cipher. There isa integer valve required to define each lair of the tex that has been moved clove, This integer vei also known a the shit ‘We can represent this concept using modular arithmetic by first transming the Iter into numbers, according the schema, A=0.B=1,C=3,D= 3-2=28 The following mathematical formule canbe sed to shift et The program implementation of Cacsar cipher algorithm isa fellows — 11:53 38 » Sua #8 python program to ilstate Caesar Cipher Technique dot enceypitexts result for in range(lea(texty char= ten] 2 Encrypt uppercase characters itteharisupper0 result += chr fordchar) 65) # Bnerypt lowers characters ke result += eht(ordchae) #+5-97)%426+97) tehesk the above funtion text ="ATTACKATONCE® » ae » 6 11:53 Print Cipher "+ encrypitests)) Outpt: {rmonsa3siet The Cacsar Cipher tchnigue is one of the calest and simplest mathod of enesyption technique. It's simply a type of subsiution cipher, i. each leer of a given lest is replaced by a eter some fixed ner of positions down the alphabet. For example with a shi of 1,/A Would be replaced by B, B would become C, and so on. The method is nparcnly named afer Julius Caesar, who apparently sed it to communicate with his ici, Thus to cipher given text we need an integer value, known a shift which indicates the ‘numb of psition each Jeter of the text his been moved down Practical No. 6 Alm: Weite a program to implement Vernam Cipher Introduction: @ 26 Introduction: Vernam Cipher in Cryptography Vernam Cipher is method of enerypting alphabetic text, Its one ofthe Transposition technigues for converting a plain txt into a ciphertext In this mechanism we asign & numb to each character ofthe Plain-Test like (a= 0,B= I,e= 2,2 2). {in Vernam cipher algorithm, we ake a key to enerypt the plaintext which length shoul be gual othe Ieagth ofthe plaintext 1. Asian a number to each character of the plainsest and the key according to alphabetical ode. 2. Add both the number (Corresponding plain-text character number and Key character umber) 11:53 » 5B 9) 6 3, Subtract the number from 26 if the aed number is greater than 26, iit snc then leaveit Example: Plain-Texts RAMSWARUPK Key: RANCHOBABA, [Now according to our encryption algorithm we assign @ number to each character of our Plintext and ey. Pr RAM SWARUPK No: 1701218220172015 10 KEY: R AN CHO BABA No: 1701327141010 Now auld the number of Plan-Text and Key and fier doing the addition and subretion operation (i required, we wil get the comrsponding Cipher-Test character umber, 40 25 20.29 14 18 20 16 10 Tnthis case, there are two numbers which are greater than the 2630 we have to subeat 26 feom them and aller applying the subiaction operation the new Cipher test chirater rumba follow ENO: 8025 20.3 14 Is 20 16 10 ‘New Cipher-Tex is afer getting the coresponng character fom the number CIPHER-TEXT: 1AZUDOSUQ K My_KEY ="sswoptteinedgifnsh Gn i eanCyphor tt") ‘ker make ernaniyph(Cpphes, MY_KEY) eames "doen Botan @ 26 11:53 ye 5B ») 6 Ea eCopt" Serpe make VernancyphoCyphe MY_KEY) Output: Boitsoe Concusion: The Vernam cipher sin theory. «perfect cipher. Instead of a single ey. cach plaintext character is enerypted using ils ow key. This key — or key steam — is randomly feneratod ori taken from a one-time pad, ea page ofa book, The Key rust be equal in length tothe plantest message. The fact that each character ofthe message is encrypted using diferent hey prevents any useUl information being revealed trough 3 Frequency analysis af the ciphertext 11:53 » 5B 9) 6 Practical No.7 ‘Alm: Create and Verify Hash Code for given message. Introduction: ‘A ash funtion sa funetion hat takes input oF avaiable length sequsace of bytes and converts it to a fined length scquence, It is @ one way funtion. This means s/s the hashing Fuetion, calculating 1 prety Tat and sine, but trying to ebiain x again will take years. The value returned! by a hash function is often tall a hash, message digest, ash val, of checksum. Most ofthe time a hash Faetion Will producenigue ouput fora given input. However depending on the srithm, theres 2 porsbiity to ind collision di othe mathematical theory behind thes functions, [Now suppose you want to hash the sting "Hello Word” with the SHA| Function theresa (add SS0K7 Ne SND2D7OIST eSdSOb ASE, ash functions ae used inside some cryptographic algorithms, in digital signa message authentication codes, manipulation detection, fngerprins. checksums [message integrity check, hashtable, password stonge and much more. As a Python programmer you may need thse functions to check for duplicate data or files, to check dat integrity ‘we you transi inematon cover a network, to securely sore passwords in databases, or maybe some work related 10 eyptography Program: ‘hash for intezer unehunwed @ 26 @4 11:54 M » 5B 9) 6 you may need these functions to check for duplicate data or fle to check data integrity ‘vic you transi information over a nctwork, to securely store passwords in databases, or maybe some work related to eyptography. Program: ‘ash for integer unchanged >> pint(Hash foe 181 ishush(181)) hash for decimal >>> print Hash for 181.23 i"hash(181.28)#hash forstring >> print Hash for Python isha Pythor) Output: Conclusion Hash mothed in Python #8 8 module that is used to return the hash value of an object. In programming the hash method sus to eum integer vis that used to compare ditionay keys using dietonary Took up feature, When used, it ells for th Iush.-() ofan object which is ct by default during the creation of the @ 26 4 Q 11:54 Rese used to compare dictionary keys using dictionary look up feature. When used, it lls for the Tush —() ofan objet which is et by deft dusing the creation of the get By Teer Practical No. 8 Alm: Write a program to implement Rail Fence technique. Ineroduetton: Rail: fence cipher is transposition cipher that enerypis the plain text by hanging the postion of each character, This cipher takes an input string and key and arranges the letters inthe string in @ diagonal fashion. Foe smplementing Rail-fece Cipher in Python, a octane grid is required with the numberof rows coresponding to the key, and the numberof columns comssponing tothe length of string tobe encrypted. Then the ciphertext is generated by Feaing the resultant grid rw by 1 Fer example Here, The number of rows the grid key = 4 The numer of cohann inthe gi Program: % Python’ program to lustate 1@ 26 @4 The numberof columns in the gid Program: % Python program to ilustate # Rail Fence Cipher Eneryption and Decryption #fanetion to enerypt a message det snoryptRaiFeneotex, ke} 2 reat the mari to cipher plaintext key = rows *Tengtb(text) ~ columns 2 filing the rail atin to distinguish filled 4 spaces from blank ones rail~ [' for in rangelentexd) Tor in rangerke) to find the direction dir down = False row, co! ~0, 0 fori in angtleltext) # check the ditecton of flow ‘reverse the direction if Weve just 2 filed the top or hota al if (cow = 0) or (ow = key - 1): tir down = not dt-down #fillthe corresponding alpabet nillrow[eol] = text) col 2 find the net row using 2 direction Mag if down 11:54 M RWWA a row +=1 se row==1 # now we can construct the cipher ‘using the rail mate result=[] for in rangtkey) for} in canae(len(ex)) ital) =" sul ppenal1GD) retun¢™ jointesu) This famotion receives ciphertext, ‘and key and returns the eizial ‘extaher decryption def decryptRailFence(cipher ey) # ereate the matt cipher 2 plain ext key = rows #lengivtext) = columns *iling the rail mati to 4 distinguish filled spaces + from blank ones [a for in range(len(ciphes)] for jin rangeckey)) 440 find the direction dir down None row, col 0,0 + mark he places with for inrangettn( cipher: ‘fro {ir down = Tue ifrow key =f die down = False # place the marker tallow fel] = find he next row @ 26 DE ace te marker ral feat} =" col 1 find he next row # using diction flag i di. doves row s= 1 else 4 now we can constuct the fll heel aten inde fort in angsty) for) im ranaetlen(cpher) if (ali) =") and {index lenephe) nlf] = eiphefindex} index = 1 4 now read the matin ro, 01 = 0,0 for in rangtle(eipher # chek the ditetion of flow ifrow down = Trve stron ey die down = False place dhe marker ‘ttl fol} =" realagpendcalow fot) cals t find the nest row using * diction Mag if dic down “owt ots: row tur ines) # Driver one ‘rn(enenprRaiFenceatck tone”, 2) ‘rn(enerypiRailF ence GesksfrUcek 3) Dnt(encryptRaiFence "dete the eas wall”, 3)) 4 Now desryption ofthe in(deryptRailFence("GsCskfick eve 3) in(deerypiRailFence’ate tot ne, 2) rn dceryptRalFeacel "daha ecdtes aU" 3)) 11:54 M RWS Conelusi Inthe mil fence cipher, the painent is writen downwands disgonlly on susosssive rails" of an imaginary fence, then moving up when the boom rail is reached, down gain when the top rails reached, and so.on until the whole plaintext is writen oi The sipher text then read Tin ows Practical No. 9 Aim: Write a program to implement Simple Columnar transposition Technique Introduction The Columnat Transposition reranges the platen lees, based on matris filed with lees in the onder determined bythe sere hyo, Tho Columnar Transposition is @ simple transposition cipher that can be performed manually, without the nesd of sing addtional equipment. Iwas very poplar throughout Century, and twas wc in various situations by diplomas, soldier, and spies. The encryption and decryption canbe performed by hand, using «piece of paper and & 11:54 M A on Tho Columnar Transpesition is simple transposition cipher that can be performed ‘manually, without the need of sing additional equipment. Iwas very poplar throughout enurics and twas usc in various situations by diplomas, soldier, a spies. The encryption and decryption canbe performed by hand, using «piece of paper and a simple matrix, into whic the user enters the eters ofthe message Example: A simple example for 4 tanspostion cipher i columnar transposition cipher where each Chaacter nthe plain texts writen horizontally with specified alphabet width, The cipher is writen vet, which erates an emely diffrent ciphertext. Consider the pln text ello work, and let us apply the simple columnar transposition technique as shown below eliyl olwlolr {4 The plaintext characters ae placed horizontally andthe cipher text is created with vertical format as: holewdlo r= Now, he receiver has ose the same table to decrypt the e text to plan text Program: 4 Python’ implementation of # Columnar Transposition import math key ="HACK’ # Eoerypion ef encrypiMesage(mse): her tack key indices ind =0 x len = flotleninsg) cis= lisse) ey Ist~ sorted istkey)) ‘caleulat column ofthe mats lenfkey) culate maximum row oF the mates yw = ineathcelfnsg ten / ol) # athe pking character” # the empty cello the mats fll nall int (row * cl) -sz_en) sg lstextend"* fill null) Sin empty » rwate Marx and insert message and 5 padding characters row-uise tmatrix = [sg Ii + cl For iin range, lenis), 0) wal matrix column-wise using key For_inrangtoo ~ "curr idx key ndexthey_lsk ind) cipher += oun rom feu] @ 26 @4 For_inrangtool curr idx ~ key ndew(key lat indx]) cipher += oin|rom eur id] Farrow in matrix)) ind == return cipher # Decryption ef doryptMessage cipher m= wack key indices Kind =0 track msg indices msg_inds 0 smsg_lea™ float(len(cipher) smsi_Ist=Fistipher) ‘caleuat column ofthe mate col lene) ‘ caleulate maximum ow ofthe max row = intimathceilimsg len / cel), convert hey into list and sort = alphabetically so we ean acess 2 each character by is alphabetical position, key et = sorte key)) creat an empty mat to # tore deciphored message dec cipher = [] for _inrangelow: ee cipher += [None] * eo!) 2 Arrange the mat column wise aeconding ‘to penmutation onder by ang ito new mati ores = hy indvthey ik nd) {rj in anger zeeipher{ four ids] = ms_simse_ ind] msg ind 11:54 M RUS a arrange the math column Wise Sce00iNg to pemnutation order by adding ito new mae for _inrangteol curr idx = key index(key lind) for] inrangetrowy eee. is} ms. ‘convert doerypred ms mati into a string ty mse" joinGum(dee cipher, [) xcept Typoror: raise TypeE or "This program cant handle repeating words") ifnull_ count 0 return mall count) return mag inher = enryptMessage(ms) Print"Enerypted Message: Formate) print"Decryped Message: ()" formatdecryptMesogelcipher)) Output: Bron 203.00 Yehoe 34:3 (apeoas Betas, Day 120, Se v.12 G4 BIE Owe Conclusion: Transposition Cipher is « cryptographic algorithm where the order of alphabets in the Plinext is cearange to form a ciphertext. In this process, the actual plain ext alphabets fre ac included. ln erypiography a ranspsiio cipher isa mod of encryption by which the positions eld by units of plaintext (which are commonly characters or groups of chariters) are shifted according to a regular system, so that the ciphertext consities a Permutation of the plaintext, That is the onder of the unite is changed (he plaintext is reordered) Mathematically bijective funtion i usd on the characters’ positions 1 encrypt snd an inverse anton o deny.

You might also like