# Can a Vigenère cipher be solved if the alphabet is modified (custom)?

Let's say I have about a statistically good sample of characters of text that appear to be uniformly distributed, but the composition of the text is [A-Z], [a-z], [0-9], +, and / — constituting basically a base64 alphabet. To me, the more or less uniform distribution of the text suggests at least a polyalphabetic cipher, and possible a Vigenère.

As far as I've been able to find, there doesn't exist any Vigenère cipher program to decipher a base64 alphabet. As an amateur coder, I can see why, but firstly the biggest obstacle to creating the code is that the + and / and separated from the rest of the characters in the ASCII lookup table, so a rotation algorithm is not straightforward, like it is for just caps.

Would it be possible to create a custom code/algorithm to code and decode base64 text using the Vigenère method?

The barrier to coding it would be the order to place the alphabet— should it be lowercase, UPPERCASE, numbers, symbols— mapped in that order, or does it matter?

Does the ordering of the alphabet matter to using a Vigenère? Can the keyword be altered to decode the cipher text in a shuffled alphabet?

See, I actually have a lot of text that I suspect is base64 Vigenère, and I also have the key— but I just don't have an algorithm to decode it.

I should probably add that the amount of characters is in the thousands, so it would not be practical to decode it by hand.

• Yes, it can certainly be done. See e.g. this question for an example. – Ilmari Karonen Aug 24 '16 at 12:23

[43, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122]

• @CayetanoGonçalves: It's possible to break a Vigenère cipher with a shuffled alphabet, but it's more difficult. Basically, instead of breaking $n$ simple Caesar shift ciphers in parallel (one for each key letter), you need to break $n$ generic substitution ciphers. Of course, since all the substitution alphabets are related by a simple shift, some effort and information can be reused. Actually, that sounds like a really nice exercise to try, once you already know how to break ordinary Vigenère and generic monoalphabetic substitution ciphers. – Ilmari Karonen Aug 24 '16 at 15:21