### Question:
EncryptUtils { public static String desEncrypt(String source) throws Exception { DESKeySpec desKeySpec = getDesKeySpec(source); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); SecretKey secretKey = keyFactory.generateSecret(desKeySpec); cipher.init(Cipher.ENCRYPT_MODE, secretKey, IV); return byte2hex( cipher.doFinal(source.getBytes(StandardCharsets.UTF_8))).toUpperCase(); }  static String desEncrypt(String source); static String desDecrypt(String source);  }### Answer:
@Test public void testDesEncrypt() { try { assertEquals("7772841DC6099402", desEncrypt("123456")); } catch (Exception e) { e.printStackTrace(); } }