content: import javax.crypto.Cipher;
  import javax.crypto.spec.SecretKeySpec;
  import java.security.Key;
  import java.text.DateFormat;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  
  public class Generator {
      /**
       * To byte array byte [ ].
       *
       * @param hexString the hex string
       * @return the byte [ ]
       */
      public static byte[] toByteArray(String hexString) {
          if (hexString == null)
              return null;
          hexString = hexString.toLowerCase();
          final byte[] byteArray = new byte[hexString.length() >> 1];
          int index = 0;
          for (int i = 0; i < hexString.length(); i++) {
              if (index  > hexString.length() - 1)
                  return byteArray;
              byte highDit = (byte) (Character.digit(hexString.charAt(index), 16) & 0xFF);
              byte lowDit = (byte) (Character.digit(hexString.charAt(index + 1), 16) & 0xFF);
              byteArray[i] = (byte) (highDit << 4 | lowDit);
              index += 2;
          }
          return byteArray;
      }
  
  
      /**
       * byte[] to Hex string.
       *
       * @param byteArray the byte array
       * @return the string
       */
  
      public static String toHexString(byte[] byteArray) {
          final StringBuilder hexString = new StringBuilder("");
          if (byteArray == null || byteArray.length <= 0)
              return null;
          for (int i = 0; i < byteArray.length; i++) {
              int v = byteArray[i] & 0xFF;
              String hv = Integer.toHexString(v);
              if (hv.length() < 2) {
                  hexString.append(0);
              }
              hexString.append(hv);
          }
          return hexString.toString().toLowerCase();
      }
  
      public static String aesEncode(String thisKey, String data) {
          try {
              Key key = new SecretKeySpec(toByteArray(thisKey),"AES");
  
              Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
              cipher.init(Cipher.ENCRYPT_MODE, key);
              byte[] result = cipher.doFinal(data.getBytes());
              return toHexString(result);
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          return null;
      }
  
      public static String getaesKey(){
          return "a841dd0541d40acb87feb121a4d4f9f7";
      }
  
      public static void main(String[] args) {
          DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
          Date date = new Date();
          String data=dateFormat.format(date);
          String key= getaesKey();
          String scannerauth=aesEncode(key,data);
          System.out.print(scannerauth);
      }
  
  }
  