title: Node.js crypto.publicEncrypt: 'Error: error:0906D06C:PEM routines:PEM_read_bio:no start line'
body: <p>I'm trying to use the public key encryption in crypto.js, I want to encrypt some message using <code>publicEncrypt</code>, and decrypt it with <code>privateDecrypt</code>.</p>
  
  <pre><code>const crypto=require('crypto');
  let alice=crypto.getDiffieHellman('modp14');
  alice.generateKeys();
  let enc=crypto.publicEncrypt(alice.getPublicKey(),Buffer.from('hello'));
  </code></pre>
  
  <p>However, the <code>crypto.publicEncrypt</code> line is causing the following error:
  "Error: error:0906D06C:PEM routines:PEM_read_bio:no start line"</p>