start with the K function

This commit is contained in:
Sebastian Hugentobler 2022-03-17 12:33:23 +01:00
parent 5d32735080
commit 2a35bbbfab
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
5 changed files with 45 additions and 0 deletions

View file

@ -5,6 +5,9 @@ package ch.fhnw.kry;
*/
public class Main {
private static final String KEY = "00111010100101001101011000111111";
private static final String CHIFFRE = "00000100110100100000101110111000000000101000111110001110011111110110000001010001010000111010000000010011011001110010101110110000";
public static void main(String[] args) {
}

View file

@ -0,0 +1,10 @@
package ch.fhnw.kry;
public class SPN {
public int k(int key, int i) {
i *= 4;
int mask = 0xFFFF >>> i;
return key & mask;
}
}