By default, gpg2 uses CAST5 for a symmetric encryption. Here
crypto = GPGME::Crypto.new()
r = crypto.encrypt "Hello world!\n", symmetric: true
r.read()
will return CAST5 data.
How to change the default cipher algo to, for example, AES256?
Well, apparently it's not possible to change the cipher through the API, but is possible w/ an indirect trick.
Create a tmp directory /foo/bar
& put in it gpg.conf
file w/ the line:
personal-cipher-preferences aes256
Set a 'home' directory for gpgme (before GPGME::Crypto.new
):
GPGME::Engine.home_dir = '/foo/bar'