Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. string cipher = getCipher();
  2.  
  3. string toBeCiphered = "blahcipherme";
  4.  
  5. int[] keysToUse = new int[strlen(cipher)];
  6. for(int i = 0;i<keysToUse.Length;i++) {
  7.     keysToUse[i] = getCharAt(cipher,i);
  8. }
  9.  
  10. string output = "";
  11. int cipherPos = 0;
  12. for(int i = 0;i<toBeCiphered.Length;i++) {
  13.     cipherPos++;
  14.     output += doTheCipherThing(keysToUse[cipherPos],toBeCiphered.charAt(i));
  15.     if(cipherPos>=keysToUse.Length) {
  16.         cipherPos = 0;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement