I can not understand the example in “Coded Correpsondece” in VIgenere Cipher section.
The example says:
Now we use the repeat the keyword over and over to generate a _keyword phrase_ that is the same length as the message we want to code. So if we want to code the message "barry is the spy" our _keyword phrase_ is "dogdo gd ogd ogd". Now we are ready to start coding our message. We shift the each letter of our message by the place value of the corresponding letter in the keyword phrase, assuming that "a" has a place value of 0, "b" has a place value of 1, and so forth. Remember, we zero-index because this is Python we're talking about! message: b a r r y i s t h e s p y keyword phrase: d o g d o g d o g d o g d resulting place value: 4 14 15 12 16 24 11 21 25 22 22 17 5 So we shift "b", which has an index of 1, by the index of "d", which is 3. This gives us an place value of 4, which is "e". Then continue the trend: we shift "a" by the place value of "o", 14, and get "o" again, we shift "r" by the place value of "g", 15, and get "x", shift the next "r" by 12 places and "u", and so forth. Once we complete all the shifts we end up with our coded message: eoxum ov hnh gvb
but resulting place imo is wrong. For example B A R R Y + D O G D O = 1, 0 17, 17, 24 + 3, 14, 6, 3, 14 = 4, 14, 23, 20, 12 NOT 4, 14, 15, 12, 16
When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!