Add PGPPacket._symmetric_key_algorithms
authorW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 05:13:57 +0000 (21:13 -0800)
committerW. Trevor King <wking@tremily.us>
Fri, 20 Dec 2013 18:56:23 +0000 (10:56 -0800)
From RFC 4880 [1]:

       ID           Algorithm
       --           ---------
       0          - Plaintext or unencrypted data
       1          - IDEA [IDEA]
       2          - TripleDES (DES-EDE, [SCHNEIER] [HAC] -
                    168 bit key derived from 192)
       3          - CAST5 (128 bit key, as per [RFC2144])
       4          - Blowfish (128 bit key, 16 rounds) [BLOWFISH]
       5          - Reserved
       6          - Reserved
       7          - AES with 128-bit key [AES]
       8          - AES with 192-bit key
       9          - AES with 256-bit key
       10         - Twofish with 256-bit key [TWOFISH]
       100 to 110 - Private/Experimental algorithm

[1]: http://tools.ietf.org/search/rfc4880#section-9.2

gpg-migrate.py

index 9c8bca68edf3f6ebe028136d38779cb014ed7962..6f49ad75d7a012d31181dca071e7979b04706ff6 100755 (executable)
@@ -74,6 +74,31 @@ class PGPPacket (dict):
         110: 'private',
         }
 
         110: 'private',
         }
 
+    _symmetric_key_algorithms = {
+        0: 'plaintext or unencrypted data',
+        1: 'idea',
+        2: 'tripledes',
+        3: 'cast5',
+        4: 'blowfish',
+        5: 'reserved',
+        6: 'reserved',
+        7: 'aes with 128-bit key',
+        8: 'aes with 192-bit key',
+        9: 'aes with 256-bit key',
+        10: 'twofish',
+        100: 'private',
+        101: 'private',
+        102: 'private',
+        103: 'private',
+        104: 'private',
+        105: 'private',
+        106: 'private',
+        107: 'private',
+        108: 'private',
+        109: 'private',
+        110: 'private',
+        }
+
     _clean_type_regex = _re.compile('\W+')
 
     def _clean_type(self):
     _clean_type_regex = _re.compile('\W+')
 
     def _clean_type(self):