code: public static String encrypt(String c, String key) {
          try {
              SecretKeySpec skeySpec = new SecretKeySpec(Hex.decodeHex(key.toCharArray()), "AES");
              Cipher cipher = Cipher.getInstance("AES");
              cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
              byte[] encoded = cipher.doFinal(c.getBytes());
              return new String(Hex.encodeHex(encoded));
  
          } catch (final Exception e) {
              logger.warn("Could not encrypt string", e);
              return null;
          }
      }
docs: Encrypts a string.
  
  @param c The string to encrypt.
  @return The encrypted string in HEX.