Created
April 27, 2011 19:07
-
-
Save martani/944949 to your computer and use it in GitHub Desktop.
Splitting Vigenere cipher into Caesar groups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static List<string> SplitTextWithKeyLen(string text, int keyLen) | |
{ | |
List<string> result = new List<string>(); | |
StringBuilder[] sb = new StringBuilder[keyLen]; | |
for (int i = 0; i < keyLen; i++) | |
sb[i] = new StringBuilder(); | |
for (int i = 0; i < text.Length; i++) | |
sb[i % keyLen].Append(text[i]); | |
foreach (var item in sb) | |
result.Add(item.ToString()); | |
result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment