Problem 42525. Vigenere cipher - be like Sherlock Holmes!

You're a young detective. Every detective needs a function to decrypt a vigenère cipher. It's a modification of a caesar cipher.

Let's talk more about the algorithm:

  • Every letter is a number. A=0, B=1, C=2, (...), Z=26
  • Output should be presented in capital letters.
  • Use ONLY letters. Without interpunction, spaces, etc
  • Function has two arguments: encrypted text and key (both are strings). Your output will present a decrypted text. Let's show it on easy example from http://en.algoritmy.net/article/45623/Vigenere-cipher

Ciphertext : CTMCCD, Key : Cat

C – C = 2 – 2 = 0 = A

T – A = 19 – 0 = 19 = T

M – T = 12 – 19 = 19 = T

C – C = 2 – 2 = 0 = A

C – A = 2 – 0 = 2 = C

D – T = 3 – 19 = 10 = K

decrypted word: ATTACK

It's quite simple,right? Good luck!

You can read more about this cipher here. Click!

Solution Stats

49.37% Correct | 50.63% Incorrect
Last Solution submitted on Mar 11, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers26

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!