From bca53f92f18a5e41fdfcf86281b37f60d90b8c5a Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Mon, 18 May 2015 07:28:24 +0200 Subject: [PATCH] import Crypto only when needed --- virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py b/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py index 9203d9c..aac9901 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/CryptoUtils.py @@ -17,7 +17,6 @@ # virtualsmartcard. If not, see . # import sys, binascii, random, logging -from Crypto.Cipher import DES3, DES, AES, ARC4#@UnusedImport from struct import pack from binascii import b2a_hex, a2b_hex from random import randint @@ -264,6 +263,7 @@ def calculate_MAC(session_key, message, iv=CYBERFLEX_IV): Cyberflex MAC is the last Block of the input encrypted with DES3-CBC """ + from Crypto.Cipher import DES3 cipher = DES3.new(session_key, DES3.MODE_CBC, iv) padded = append_padding(8, message, 0x01) block_count = len(padded) / cipher.block_size