From 2d53d984373532d329398c05f5111b0650008545 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Sat, 19 Mar 2022 16:58:22 +0100 Subject: [PATCH] =?UTF-8?q?keys=20that=20are=20not=200=20or=20r=20need=20t?= =?UTF-8?q?o=20be=20permutated=20during=20encryption=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ch/fhnw/kry/SPN.java | 2 +- src/test/java/ch/fhnw/kry/SPNTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/fhnw/kry/SPN.java b/src/main/java/ch/fhnw/kry/SPN.java index 3b9ef91..a0f83b3 100644 --- a/src/main/java/ch/fhnw/kry/SPN.java +++ b/src/main/java/ch/fhnw/kry/SPN.java @@ -88,7 +88,7 @@ public class SPN { for (int i = 3; i > 0; i--) { x = substitution(x, SBOX_REVERSE); x = permutation(x); - x ^= k(key, i); + x ^= permutation(k(key, i)); } x = substitution(x, SBOX_REVERSE); diff --git a/src/test/java/ch/fhnw/kry/SPNTest.java b/src/test/java/ch/fhnw/kry/SPNTest.java index 782408b..4c18b3f 100644 --- a/src/test/java/ch/fhnw/kry/SPNTest.java +++ b/src/test/java/ch/fhnw/kry/SPNTest.java @@ -63,7 +63,7 @@ class SPNTest { } @Test - void sp() { + void blockEncryptionDecryption() { var spn = new SPN(); int x = 0x128F ;