Guest User

Untitled

a guest
Jan 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package main;
  2.  
  3. public class main {
  4.  
  5.     /**
  6.      * @param args
  7.      */
  8.     public static void main(String[] args)
  9.     {
  10.         char[] schlüssel = {'t', 'e', 's', 't'};
  11.         char[] toChifre = {'t', 'e', 's', 't'};
  12.         int i = 0;
  13.         int[] verschlüsselt = {1, 1, 1, 1, 1};
  14.         try {
  15.             while(i<3)
  16.             {
  17.                 verschlüsselt[i]  = toChifre[i]^schlüssel[i];
  18.                 i++;
  19.             }
  20.         } catch(Exception e) {
  21.             System.out.println("Error. Failded to XOR");
  22.         }
  23.         i = 0;
  24.         while(i<3)
  25.         {
  26.             System.out.print(verschlüsselt[i]);
  27.             i++;
  28.         }
  29.     }
  30. }
Add Comment
Please, Sign In to add comment