@@ -81,16 +81,16 @@ private String[] getSubkeys(String originalKey) {
81
81
}
82
82
String [] subKeys = new String [16 ];
83
83
String initialPermutedKey = permutedKey .toString ();
84
- String C0 = initialPermutedKey .substring (0 , 28 );
85
- String D0 = initialPermutedKey .substring (28 );
84
+ String c0 = initialPermutedKey .substring (0 , 28 );
85
+ String d0 = initialPermutedKey .substring (28 );
86
86
87
87
// We will now operate on the left and right halves of the permutedKey
88
88
for (i = 0 ; i < 16 ; i ++) {
89
- String Cn = C0 .substring (KEY_SHIFTS [i ]) + C0 .substring (0 , KEY_SHIFTS [i ]);
90
- String Dn = D0 .substring (KEY_SHIFTS [i ]) + D0 .substring (0 , KEY_SHIFTS [i ]);
91
- subKeys [i ] = Cn + Dn ;
92
- C0 = Cn ; // Re-assign the values to create running permutation
93
- D0 = Dn ;
89
+ String cN = c0 .substring (KEY_SHIFTS [i ]) + c0 .substring (0 , KEY_SHIFTS [i ]);
90
+ String dN = d0 .substring (KEY_SHIFTS [i ]) + d0 .substring (0 , KEY_SHIFTS [i ]);
91
+ subKeys [i ] = cN + dN ;
92
+ c0 = cN ; // Re-assign the values to create running permutation
93
+ d0 = dN ;
94
94
}
95
95
96
96
// Let us shrink the keys to 48 bits (well, characters here) using pc2
@@ -169,18 +169,18 @@ private String encryptBlock(String message, String[] keys) {
169
169
for (i = 0 ; i < 64 ; i ++) {
170
170
permutedMessage .append (message .charAt (IP [i ] - 1 ));
171
171
}
172
- String L0 = permutedMessage .substring (0 , 32 );
173
- String R0 = permutedMessage .substring (32 );
172
+ String e0 = permutedMessage .substring (0 , 32 );
173
+ String f0 = permutedMessage .substring (32 );
174
174
175
175
// Iterate 16 times
176
176
for (i = 0 ; i < 16 ; i ++) {
177
- String Ln = R0 ; // Previous Right block
178
- String Rn = xOR (L0 , feistel (R0 , keys [i ]));
179
- L0 = Ln ;
180
- R0 = Rn ;
177
+ String eN = f0 ; // Previous Right block
178
+ String fN = xOR (e0 , feistel (f0 , keys [i ]));
179
+ e0 = eN ;
180
+ f0 = fN ;
181
181
}
182
182
183
- String combinedBlock = R0 + L0 ; // Reverse the 16th block
183
+ String combinedBlock = f0 + e0 ; // Reverse the 16th block
184
184
permutedMessage .setLength (0 );
185
185
for (i = 0 ; i < 64 ; i ++) {
186
186
permutedMessage .append (combinedBlock .charAt (IP_INVERSE [i ] - 1 ));
0 commit comments