|
|
@@ -51,6 +51,10 @@ public class Crypto {
|
|
51
|
51
|
}
|
|
52
|
52
|
|
|
53
|
53
|
public String getCipherText() {
|
|
|
54
|
+ return getNormalizedCipherText().replaceAll("\\s", "");
|
|
|
55
|
+ }
|
|
|
56
|
+
|
|
|
57
|
+ public String getNormalizedCipherText() {
|
|
54
|
58
|
StringBuilder cipherText = new StringBuilder(normalizedPlaintext.length());
|
|
55
|
59
|
|
|
56
|
60
|
for (int index = 0; index < squareSize; index++) {
|
|
|
@@ -59,14 +63,12 @@ public class Crypto {
|
|
59
|
63
|
cipherText.append(segment.charAt(index));
|
|
60
|
64
|
}
|
|
61
|
65
|
}
|
|
|
66
|
+
|
|
|
67
|
+ if (index < squareSize - 1) {
|
|
|
68
|
+ cipherText.append(" ");
|
|
|
69
|
+ }
|
|
62
|
70
|
}
|
|
63
|
71
|
|
|
64
|
72
|
return cipherText.toString();
|
|
65
|
73
|
}
|
|
66
|
|
-
|
|
67
|
|
- public String getNormalizedCipherText() {
|
|
68
|
|
- String cipher = getCipherText();
|
|
69
|
|
-
|
|
70
|
|
- return String.join(" ", getSegmentText(cipher, squareSize - 1));
|
|
71
|
|
- }
|
|
72
|
74
|
}
|