folgendes Problem: Ich möchte Dateien mittels python-gnupg verschlüsseln, dabei soll als Verschlüsselungsalgorithmus möglichst AES256 zum Einsatz kommen. Im Terminal geht das auch ohne weiteres, stellt sich nur die Frage wie das mittels des Wrappers funktioniert.
Code: Alles auswählen
$ python
Python 3.3.2 (default, May 21 2013, 15:40:45)
[GCC 4.8.0 20130502 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gnupg
>>> gpg = gnupg.GPG()
>>> with open('raw.txt', 'r') as fileRead:
... gpg.encrypt_file(fileRead, recipients=None, symmetric=True, armor=False, output='raw.txt.gpg')
...
>>>
mfg