@param args
(String[] args)
| 8 | * @param args |
| 9 | */ |
| 10 | public static void main(String[] args) { |
| 11 | EnCrypt encrypt = new EnCrypt(); |
| 12 | |
| 13 | if (args.length != 4) |
| 14 | System.exit(16); |
| 15 | |
| 16 | String function = args[0]; |
| 17 | String password = args[1]; |
| 18 | String keylen = args[2]; |
| 19 | String text = args[3]; |
| 20 | |
| 21 | String result = ""; |
| 22 | if (function.equalsIgnoreCase("encrypt-rc2")) |
| 23 | result = encrypt.encryptRC2(text, password, Integer.parseInt(keylen)); |
| 24 | else if (function.equalsIgnoreCase("decrypt-rc2")) |
| 25 | result = encrypt.decryptRC2(text, password, Integer.parseInt(keylen)); |
| 26 | else |
| 27 | System.exit(14); |
| 28 | |
| 29 | if (result.equals("")) |
| 30 | System.exit(4); |
| 31 | |
| 32 | System.out.print(result); |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected