Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me code this on Matlab? Program Input Enter message to decrypt: .Enter secret key: The user will always enter text for

Can you please help me code this on Matlab? image text in transcribedimage text in transcribed

Program Input Enter message to decrypt: .Enter secret key: The user will always enter text for all prompts, no error checking needed. The secret key will always be lower case to start Program Outputs Updated key: XXX Replace XXX with the adjusted secret key Decrypted message: YYY Replace YYY with the deciphered message Assignment Details This assignment will give you a brief introduction into cryptography using a odified Vigenere Cipher Cryptography allows us to encode and decode cssages that are diflicul to decipher without knowledge of a secret key/table/rules. Cryptography is a rich subject in its own right and we will not have time to cover it in detail. Please check out the numerous online resources if you want more information: http://www.braingle.com/brainteasers/codes/index.php This particular cipher depends upon a secret key (a single word, lowercase letters only) that is paird with a phrasc. For cxample, given the phrase: Attack Now! the user could choose the socret key: The first step to encryption is to repeat the letters in secret key backwards until it has the same amount of letters as the message, skipping any spaces or punctuation! So with woot as the key, repeat the letters w, o, o, t for each letter in Attack Now! backwards Note that you must also change the letters in the key to upper case if the letters in phrase are upper case Now cach letter in the secret message determincs how far to shift the corresponding letter in the updated key. Essentially, take the position in the alphabet (starting from 0) of the letters in message and then shift the letters in your updated key by that amount (like a Caesar Cipher). Any letters that leave the alphabet range must be rotated back in. Also, treat upper case and lower case letters as two different alphabets. Here is a detailed breakdown: Letter in mcssage Alphabct pos. (from 0) Letter in kcy Encrypted letter Tm 19 10 Following this table, Attack Now! becollies wmhovd Bes!. To decode this message for the homework, do the reverse of this process! Program Input Enter message to decrypt: .Enter secret key: The user will always enter text for all prompts, no error checking needed. The secret key will always be lower case to start Program Outputs Updated key: XXX Replace XXX with the adjusted secret key Decrypted message: YYY Replace YYY with the deciphered message Assignment Details This assignment will give you a brief introduction into cryptography using a odified Vigenere Cipher Cryptography allows us to encode and decode cssages that are diflicul to decipher without knowledge of a secret key/table/rules. Cryptography is a rich subject in its own right and we will not have time to cover it in detail. Please check out the numerous online resources if you want more information: http://www.braingle.com/brainteasers/codes/index.php This particular cipher depends upon a secret key (a single word, lowercase letters only) that is paird with a phrasc. For cxample, given the phrase: Attack Now! the user could choose the socret key: The first step to encryption is to repeat the letters in secret key backwards until it has the same amount of letters as the message, skipping any spaces or punctuation! So with woot as the key, repeat the letters w, o, o, t for each letter in Attack Now! backwards Note that you must also change the letters in the key to upper case if the letters in phrase are upper case Now cach letter in the secret message determincs how far to shift the corresponding letter in the updated key. Essentially, take the position in the alphabet (starting from 0) of the letters in message and then shift the letters in your updated key by that amount (like a Caesar Cipher). Any letters that leave the alphabet range must be rotated back in. Also, treat upper case and lower case letters as two different alphabets. Here is a detailed breakdown: Letter in mcssage Alphabct pos. (from 0) Letter in kcy Encrypted letter Tm 19 10 Following this table, Attack Now! becollies wmhovd Bes!. To decode this message for the homework, do the reverse of this process

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions