Question
Question 2 (30 points) In cryptography, Encryption is the process of encoding information. This process transforms the original representation of information known as plaintext into
Question 2 (30 points) In cryptography, Encryption is the process of encoding information. This process transforms the original representation of information known as "plaintext" into another form called "ciphertext". The goal is that only the parties decrypt the encrypted message in order to retrieve the original message. There are several encryption algorithms but in this assignment, our goal is quite modest because we just want to implement one of the first encryption algorithms known as 'Caesar cipher https://en.wikipedia.org/wiki/Caesar_cipher This encryption algorithm just shifts the characters according to a predefined constant and we assume that the text to encrypt contains only the lower case letters of the Latin alphabet, i.e. the 26 letters from "a" to "z", inclusive. Here are the specifications of our implementation: - The EncryptionCesar class will contain just the one variable needed for encryption which is the offset. It will contain just 3 methods: the constructor and the two functions Encrypt and Decrypt. - The main method is also defined in the EncryptionCesar class. It will just be used to execute a simple visual test which is to encrypt and decrypt a string sent to the command line. You are asked to : - Complete the EncryptionCesar class - Create the UnitTestEncryptionCesar class. This class will contain a single test unit which must have the signature @Test public void testEncryption(). The content of the code must generate random strings of characters 10 times, encrypt them then decrypt them and verify that the decrypted text matches the original text. o Hint: You can use the Random class to generate random strings. As an example, here is the result of the execution of " java EncryptionCesar lecoursnestpenn ennuyant 3"
Question 2 (30 points) En cryptographie, I'Encryption est le processus de coder l'information. Ce processus transforme la reprsentation originale de l'information connu sous " plaintext sous une autre forme appel ciphertext . Le but est que seules les parties concernes pourront dcrypter le message cod afin de retrouver le message original. Il existe plusieurs algorithmes d'encryptions mais dans ce devoir, notre but est assez modeste car on veut juste implmenter un des premiers algorithmes d'encryptions connus sous le nom de 'Caesar cipher' Cet algorithme d'encryption dcale juste les caractres selon une constante prdfinie et on assume que le texte encrypter contient uniquement les lettres de l'alphabet latin en minuscule, i.e. Les 26 lettres de a z, inclusivement. Voici les spcifications de notre implmentation : - La classe EncryptionCesar contiendra juste la seule variable ncessaire l'encryption qui est le dcalage. Elle contiendra juste 3 mthodes : le constructeur ainsi que les deux fonctions Encrypter et Decrypter. - La mthode main est aussi dfinie dans la classe EncryptionCesar. Elle va juste servir excuter un test visuel simple qui est d'encrypter et decrypter un chaine de caractres envoy la ligne de commande. On vous demande de: - Complter la classe EncryptionCesar - Crer la classe UnitTestEncryptionCesar. Cette dernire contiendra un seul unit test qui doit avoir la signature @Test public void testEncryption(). Le contenu du code doit gnrer des chaines de caractres alatoires 10 fois, les encrypter puis les dcrypter et vrifier que le texte dcrypte concide avec le texte original. o Hint : Vous pouvez vous inspirer de la classe Random afin de gnrer des Strings alatoires. A titre d'exemple, voici Le rsultat de l'excution de java EncryptionCesar lecoursnestpasennuyant 3" Message avant Encryption: lecoursnestpasennuyant Message apres Encryption: ohfrxuvqhvwsdvhqqxbdqw (decalage=3) Message apres Decryption: lecoursnestpasennuyant Message avant Encryption: lecoursnestpasennuyant Message apres Encryption: ohfrxuvqh wisdwhqqxbdqm (decalage=3) Message apres Decryption: lecoursnestpasennuyantStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started