title: How secure `openssl rsautl -sign` is comparing to `openssl dgst -sign`?
body: <p>I was doing research about a way to generate a digital signature of a file and found that there were at least two ways: <code>openssl rsautl -sign</code> and <code>openssl dgst -sign</code>.</p>
  
  <p>I understand the difference between them at an algorithm level by reading <a href="https://stackoverflow.com/questions/9951559/difference-between-openssl-rsautl-and-dgst">Difference between openSSL rsautl and dgst</a></p>
  
  <p>I am wondering if there is a difference between them at a security level . I suppose that the difference between them is the ASN1 encoding and that does not affect the strength of the security level of <code>openssl rsautl -sign</code>. But if possible, I would like to make sure it. </p>
  
  <p>I am planning to implement this in Ruby. It seems to me that <code>openssl dgst -sign</code> can be implemented by using <code>sign</code> in <code>OpenSSL::PKey::RSA</code> and <code>openssl rsautl -sign</code> can be implemented by using <code>private_encrypt</code> in <code>OpenSSL::PKey::RSA</code>. </p>