Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string cipher = getCipher();
- string toBeCiphered = "blahcipherme";
- int[] keysToUse = new int[strlen(cipher)];
- for(int i = 0;i<keysToUse.Length;i++) {
- keysToUse[i] = getCharAt(cipher,i);
- }
- string output = "";
- int cipherPos = 0;
- for(int i = 0;i<toBeCiphered.Length;i++) {
- cipherPos++;
- output += doTheCipherThing(keysToUse[cipherPos],toBeCiphered.charAt(i));
- if(cipherPos>=keysToUse.Length) {
- cipherPos = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement