title: generate RSA 1024 key pair using openssl
body: <p>I'd like to generate RSA 1024 key pairs. What I got from google is</p>
  
  <pre><code> openssl genrsa -out privatekey.txt 1024 
   openssl rsa -in privatekey.txt -pubout -out publickey.txt
  </code></pre>
  
  <p>but why these two files are in different size(608 bytes and 162 bytes)? the key pair of RSA 1024 should be the same size, right?</p>
  
  <p>and these files begin with </p>
  
  <p>0x30 0x81...</p>
  
  <p>and</p>
  
  <p>0x30 0x82...</p>
  
  <p>it's pem format? How could they be used with openssl?</p>
  
  <pre><code>RSA* rsa = RSA_new();
  BN_hex2bn(&amp;rsa-&gt;n, WHAT_HERE);
  BN_hex2bn(&amp;rsa-&gt;e, AND_WHAT_HERE);
  RSA_public_encrypt(....);
  </code></pre>
  
  <p>Thanks.</p>