title: How do I encrypt a file with Ruby using symmetric AES256 that can be decrypted with gpg?
body: <p>How do I create an encrypted file in Ruby with the following constraints?</p>
  
  <ol>
  <li>Data is an array of bytes supplied by an untrusted user.</li>
  <li>Password is an array of bytes supplied by an untrusted user.</li>
  <li>Password accepts all frequently used password characters, including <a href="https://www.owasp.org/index.php/Password_special_characters" rel="nofollow">password special characters</a> (e.g. ', ", etc.).</li>
  <li>The file format should be a commonly used format such as OpenPGP.</li>
  <li>The encrypted file is sent back to the user.</li>
  </ol>
  
  <p><em>Note:</em> Question clarified after a misunderstanding.</p>