title: convert aes encryption in JAVA to node
body: <p>I have a script in java</p>
  
  <pre><code>private static final String ALGO = "AES";
  
  public static String encrypt(String Data,String secretKeyPhrase) throws Exception {
  
      Key key = new SecretKeySpec(secretKeyPhrase.getBytes(), ALGO);
  
      Cipher c = Cipher.getInstance(ALGO);
      c.init(Cipher.ENCRYPT_MODE, key);
      byte[] encVal = c.doFinal(Data.getBytes());
      String encryptedValue = Base64.getEncoder().encodeToString(encVal);
      encryptedValue= URLEncoder.encode(encryptedValue, "UTF-8");
      return encryptedValue;
  }
  
  
  public static void main(String [] ar) throws Exception{
      String result2=AESUtil.encrypt("3483", "BDFHJLNPpnljhfdb");
      System.out.println(result2);
  }
  </code></pre>
  
  <p>i need to replicate this in node i do this </p>
  
  <pre><code>var ciphertext = CryptoJS.AES.encrypt('3483', 'BDFHJLNPpnljhfdb').toString();
  </code></pre>
  
  <p>console.log(ciphertext); </p>
  
  <p>in the java result show me </p>
  
  <pre><code>3483
  </code></pre>
  
  <p>sAllhJ7zLxBKr8hJ7tLf9w%3D%3D</p>
  
  <p>but in node </p>
  
  <pre><code>3483
  </code></pre>
  
  <p>U2FsdGVkX19Z/mnjJy3hYDcXfWnH5eayYngWMtUT1lw=</p>
  
  <p>what i am doing wrong?</p>
  
  <p>thanks in advance.</p>