1. Homepage
  2. Homework
  3. UM-SJTU VG101 22SU - Homework2 - Caesar Cipher

UM-SJTU VG101 22SU - Homework2 - Caesar Cipher

Engage in a Conversation
This question has been solved

Problem 6


CourseNana.COM

Background: One field of computer science is cryptography, which studies the techniques for secure communication in the presence of third parties, adversaries. In classical symmetric-key algorithms, both sender and receiver use the same cryptographic key to encrypt the text. The encrypted text will then be sent to the other parties. The other party will use the same key to decrypt the text to get the original message. This scheme works under the assumption that if the CourseNana.COM

adversary does not know the private key, he would not be able to decrypt the message even if he intercept the encrypted message. CourseNana.COM


CourseNana.COM

In symmetric-key algorithms, Caesar Cipher is one of the oldest ciphers in human history, as you can probably tell from its name (Caesar). In Caesar cipher, each character in the text will be shifts a given number of places (key) down the alphabets. For example, for a cipher key: 2 , the character 'a' will be shifted to 'c', and 'z' will be shifted to 'b'. CourseNana.COM


CourseNana.COM

Question: Write a function caesarCipher which takes a cryptographic key n and a message in character strings from the user and output the corresponding encrypted text according to the ASCII code. The input will be alphabet and numbers. Numbers also follow rotation cipher when meeting the end. Message only consists of alphabetic and numeric characters. CourseNana.COM


CourseNana.COM

Example: CourseNana.COM

Input: caesarCipher(2, 'ThisisVZ109') CourseNana.COM

Output: 'VjkukuXB321' CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Matlab代写,Caesar Cipher代写,Symmetric-key algorithms代写,Matlab代编,Caesar Cipher代编,Symmetric-key algorithms代编,Matlab代考,Caesar Cipher代考,Symmetric-key algorithms代考,Matlabhelp,Caesar Cipherhelp,Symmetric-key algorithmshelp,Matlab作业代写,Caesar Cipher作业代写,Symmetric-key algorithms作业代写,Matlab编程代写,Caesar Cipher编程代写,Symmetric-key algorithms编程代写,Matlabprogramming help,Caesar Cipherprogramming help,Symmetric-key algorithmsprogramming help,Matlabassignment help,Caesar Cipherassignment help,Symmetric-key algorithmsassignment help,Matlabsolution,Caesar Ciphersolution,Symmetric-key algorithmssolution,