Vigenere Cipher

Problem #294

Tags: unlabeled

Who solved this?

No translations... yet

If you are not acquainted with Caesar's Cipher, please solve the corresponding task first...

We've already seen that Caesar's Cipher could be easily broken with the analysis of letter frequencies.

Vigenere's algorithm brings improvement. We choose not just a single shift value, but small array of such values (let us call it key), and then each next letter of the original text is shifted by the next value from the key.

Of course if the key is very long (especially, as long as the original text itself) the system becomes unbrekable. However in practice the key is usually short enough (represented by some word) and we wrap to its beginning after reaching the end - thus the algorithm is imperfect.

So let's assume that:

Before we try to break it, let's write the implementation of this algorithm, to make sure we understand it properly.

Input data the first line contains the text to be encoded, only small latin letters with no spaces.
The second line contains the key.

Answer should give the encrypted text.

Example:

input data:
attackatdusk
cab

answer:
ctucclctewsl
You need to login to get test data and submit solution.