How do I create an encrypted file in Ruby with the following constraints?

1. Data is an array of bytes supplied by an untrusted user.
2. Password is an array of bytes supplied by an untrusted user.
3. Password accepts all frequently used password characters, including [password special characters](https://www.owasp.org/index.php/Password_special_characters) (e.g. ', ", etc.).
4. The file format should be a commonly used format such as OpenPGP.
5. The encrypted file is sent back to the user.

*Note:* Question clarified after a misunderstanding.