package sommer2013fs;

public class Sommer2013FS {

    public static void main(String[] args) {
        System.out.println(chiffriere("Ölkännchen", "geheimcode")) ;
    }
    
    
    public static String chiffriere(String klartext, String schluessselwort) {
        char[] ktchar = klartext.toCharArray();
        char[] swchar = schluessselwort.toCharArray();
        char[] result = new char[ktchar.length];
        for (int i = 0; i < ktchar.length; i++) {
            result[i] = (char)((ktchar[i] + swchar[i]) % 256);
        }
        return new String(result);
    }
    
}
