From: W. Trevor King Date: Mon, 23 Dec 2013 21:44:00 +0000 (-0800) Subject: Add PyCrypto modules for public-key encryption to PGPPacket._crypto_module X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1226bea4ba076c4953daf406542c1844ecafe28e;p=gpg-migrate.git Add PyCrypto modules for public-key encryption to PGPPacket._crypto_module Maintained by Dwayne C. Litzenberger [1,2,3]. Also add comments to the _crypto_module definition, because the symmetric-key and public-key entries are in different alphebetization blocks. [1]: http://www.pycrypto.org/ [2]: https://www.dlitz.net/software/pycrypto/ [3]: https://github.com/dlitz/pycrypto/ --- diff --git a/gpg-migrate.py b/gpg-migrate.py index 21bbc8c..1359729 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -11,6 +11,9 @@ import Crypto.Cipher.AES as _crypto_cipher_aes import Crypto.Cipher.Blowfish as _crypto_cipher_blowfish import Crypto.Cipher.CAST as _crypto_cipher_cast import Crypto.Cipher.DES3 as _crypto_cipher_des3 +import Crypto.PublicKey.DSA as _crypto_publickey_dsa +import Crypto.PublicKey.ElGamal as _crypto_publickey_elgamal +import Crypto.PublicKey.RSA as _crypto_publickey_rsa def _get_stdout(args, stdin=None): @@ -136,12 +139,19 @@ class PGPPacket (dict): } _crypto_module = { + # symmetric-key encryption 'aes with 128-bit key': _crypto_cipher_aes, 'aes with 192-bit key': _crypto_cipher_aes, 'aes with 256-bit key': _crypto_cipher_aes, 'blowfish': _crypto_cipher_blowfish, 'cast5': _crypto_cipher_cast, 'tripledes': _crypto_cipher_des3, + # public-key encryption + 'dsa (digital signature algorithm)': _crypto_publickey_dsa, + 'elgamal (encrypt-only)': _crypto_publickey_elgamal, + 'rsa (encrypt or sign)': _crypto_publickey_rsa, + 'rsa encrypt-only': _crypto_publickey_rsa, + 'rsa sign-only': _crypto_publickey_rsa, } _key_size = { # in bits