This method returns plaintext for the ciphertext passed as the first parameter decoded using the key passed as the second parameter @param String ciphertext is the text which is to be decrypted @param String key is the key which is to be used for generating cipher text @return String plainText is t
(String cipherText, String key)
| 1227 | * @return String plainText is the decrypted text |
| 1228 | */ |
| 1229 | String decrypt(String cipherText, String key) { |
| 1230 | // generating key |
| 1231 | keyGenerate(key); |
| 1232 | |
| 1233 | for (int i = 17; i > 1; i--) { |
| 1234 | cipherText = round(i, cipherText); |
| 1235 | } |
| 1236 | |
| 1237 | // postprocessing |
| 1238 | String right = cipherText.substring(0, 8); |
| 1239 | String left = cipherText.substring(8, 16); |
| 1240 | right = xor(right, subKeys[1]); |
| 1241 | left = xor(left, subKeys[0]); |
| 1242 | return left + right; |
| 1243 | } |
| 1244 | } |
nothing calls this directly
no test coverage detected