Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Selecting symmetric cipher with GnuPGInterface

6 views
Skip to first unread message

Steve Crook

unread,
Jun 18, 2010, 6:08:36 AM6/18/10
to
Hi all,

I'm using the GnuPGInterface module in Python to perform symmetric
encryption:

def symmetric(passphrase, payload):
gnupg.options.armor = 1
gnupg.options.meta_interactive = 0
proc = gnupg.run(['--symmetric'], create_fhs=['stdin', 'stdout',
'passphrase'])
proc.handles['passphrase'].write(passphrase)
proc.handles['passphrase'].close()
proc.handles['stdin'].write(payload)
proc.handles['stdin'].close()
ciphertext = proc.handles['stdout'].read()
proc.handles['stdout'].close()
proc.wait()
return ciphertext

Currently this works fine but defaults to using CAST5 as the cipher.
Does anyone know of a way to pass cipher-algo to it so as to change this
to AES256, Blowfish, etc?

0 new messages