title: Generate AES key on node
body: <p>I'm dealing with a legacy application that uses a custom protocol to cipher communication. Random AES keys are generated in legacy Java app like this:</p>
  
  <pre><code>keygen = KeyGenerator.getInstance("AES");
  keygen.init(128);
  keygen.generateKey().getEncoded();
  </code></pre>
  
  <p>I've been looking for solutions on <a href="http://nodejs.org/api/crypto.html" rel="nofollow">crypto</a> with no luck. How can I generate this key on nodejs?</p>