@Test public void encryptString() throws Exception { assertArrayEquals(TripleDES.encryptString("ana123!@#".getBytes()), new byte[]{6, -61, -37, 96, 99, 60, -8, 90, -109, 31, -68, -91, -33, 6, 44, -86}); }
static byte[] encryptString(final byte[] text) throws Exception { final SecretKey key = new SecretKeySpec(TripleDES.md5Hash("NpWsCaJQj1LaXt)YYnzr\\%zP~RydB*3YGutr*@|A\\ckG3\\Yf%k"), ENCRYPTION_KEYSPECTYPE); final Cipher cipher = Cipher.getInstance(ENCRYPTION_MODE); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(text); }
TripleDES { static byte[] encryptString(final byte[] text) throws Exception { final SecretKey key = new SecretKeySpec(TripleDES.md5Hash("NpWsCaJQj1LaXt)YYnzr\\%zP~RydB*3YGutr*@|A\\ckG3\\Yf%k"), ENCRYPTION_KEYSPECTYPE); final Cipher cipher = Cipher.getInstance(ENCRYPTION_MODE); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(text); } }
TripleDES { static byte[] encryptString(final byte[] text) throws Exception { final SecretKey key = new SecretKeySpec(TripleDES.md5Hash("NpWsCaJQj1LaXt)YYnzr\\%zP~RydB*3YGutr*@|A\\ckG3\\Yf%k"), ENCRYPTION_KEYSPECTYPE); final Cipher cipher = Cipher.getInstance(ENCRYPTION_MODE); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(text); }  }
TripleDES { static byte[] encryptString(final byte[] text) throws Exception { final SecretKey key = new SecretKeySpec(TripleDES.md5Hash("NpWsCaJQj1LaXt)YYnzr\\%zP~RydB*3YGutr*@|A\\ckG3\\Yf%k"), ENCRYPTION_KEYSPECTYPE); final Cipher cipher = Cipher.getInstance(ENCRYPTION_MODE); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(text); }  static String encryptPassword(@NotNull final String aPlainPass); static byte[] md5Hash(@NotNull final String toHash); }
TripleDES { static byte[] encryptString(final byte[] text) throws Exception { final SecretKey key = new SecretKeySpec(TripleDES.md5Hash("NpWsCaJQj1LaXt)YYnzr\\%zP~RydB*3YGutr*@|A\\ckG3\\Yf%k"), ENCRYPTION_KEYSPECTYPE); final Cipher cipher = Cipher.getInstance(ENCRYPTION_MODE); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(text); }  static String encryptPassword(@NotNull final String aPlainPass); static byte[] md5Hash(@NotNull final String toHash);  }