Some critical details that are not in the docs, nor widely written about elsewhere.
- The envelope key is a 128-bit RSA key, randomly generated.
- The data is encrypted with (A)RC4 using the envelope key.
- The envelope key is encrypted for transmission with PKCS1 v1.5. It is NOT the OAEP padding variant. PKCS1 v1.5 is even older, and not widely supported anymore.
At least this was true for openssl_seal in PHP 7.2 that we are using.
(Note: In Python you can decrypt this envelope key with the Cryptography package, using padding.PKCS1v15())
The combination of RC4 and PKCS1 v1.5 make this function actually semi-obsolete for security use in my opinion.