Does anyone know if ruby implements something similar to the openssl_seal function from PHP? I’d like to be able to interact with a server running a modified implementation of this answer. The PHP solution is pretty simple and it’d be great if I could find something for Ruby to do the same.
Somebody was looking for the same for python a year ago, but didn’t find anything.
EVP_Seal does simple wrapping with RSA so you can do it manually with OpenSSL features.
Here’s a PHP script that does seal with 1 cert:
and a Ruby script that unseal it:
You can do ‘seal’ with Ruby as well but creating secure session key (RC4 key for this example) is rather difficult so you’d better not try to do by yourself.