adjust versioned encryption parameters
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Fri, 24 Mar 2017 10:12:29 +0000 (11:12 +0100)
committerPhilipp Gesang <philipp.gesang@intra2net.com>
Fri, 24 Mar 2017 10:12:32 +0000 (11:12 +0100)
Prepare for revised versioning: Both the encryption mechanism and
the KDF may be specified in the versioning.

deltatar/crypto.py

index 0330552..77ce90e 100755 (executable)
@@ -63,14 +63,16 @@ __all__ = [ "hdr_make", "hdr_read", "hdr_fmt", "hdr_fmt_pretty"
 
 ENCRYPTION_PARAMETERS = \
     { 0: \
-        { "kdf": ("dummy", 16) }
+        { "kdf": ("dummy", 16)
+        , "enc": "passthrough" }
     , 1: \
-        { "kdf": ("scrypt",
-            { "dkLen"    : 16
-            , "N"        : 1 << 15
-            , "r"        : 8
-            , "p"        : 1
-            , "NaCl_LEN" : 16 }) } }
+        { "kdf": ( "scrypt"
+                 , { "dkLen"    : 16
+                   , "N"        : 1 << 16
+                   , "r"        : 8
+                   , "p"        : 1
+                   , "NaCl_LEN" : 16 })
+        , "enc": "aes-gcm" } }
 
 
 ###############################################################################