The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 438 Weeks Ago, 1 Day Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
Vigenère cipher. The trouble with a monoalphabetic cipher is that it can be easily broken by frequency analysis. The so-called Vigenère cipher overcomes this problem by encoding a letter into one of several cipher letters, depending on its position in the input document. Choose a keyword, for example TIGER. Then encode the first letter of the input text like this:
![]()
The encoded alphabet is just the regular alphabet shifted to start at T, the first letter of the keyword TIGER. The second letter is encrypted according to the following map.

The third, fourth, and fifth letters in the input text are encrypted using the alphabet sequences beginning with characters G, E, and R, and so on. Because the key is only five letters long, the sixth letter of the input text is encrypted in the same way as the first.
Write a program that encrypts or decrypts an input text according to this cipher.
PRO-----------GRA-----------M #-----------inc-----------lud-----------e #-----------inc-----------lud-----------e #-----------inc-----------lud-----------e #-----------inc-----------lud-----------e v-----------oid----------- en-----------cry-----------pt(-----------cha-----------r[]-----------); -----------voi-----------d m-----------ain-----------() -----------{ c-----------lrs-----------cr(-----------); -----------cha-----------r a-----------[60-----------]; -----------cou-----------t g-----------ets-----------(a)-----------; e-----------ncr-----------ypt-----------(a)-----------; g-----------etc-----------h()-----------; }----------- vo-----------id -----------enc-----------ryp-----------t(c-----------har-----------