(String value)
| 373 | }; |
| 374 | |
| 375 | public static String encrypt(String value) throws Exception { |
| 376 | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); |
| 377 | SecretKey key = keyFactory.generateSecret(new PBEKeySpec(PASSWORD)); |
| 378 | Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES"); |
| 379 | pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(SALT, 20)); |
| 380 | return String.valueOf(encode(pbeCipher.doFinal(value.getBytes(StandardCharsets.UTF_8)))); |
| 381 | } |
| 382 | |
| 383 | public static String decrypt(String value) throws Exception { |
| 384 | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES"); |
nothing calls this directly
no test coverage detected