From: Victor Wagner Date: Fri, 6 Jun 2014 13:59:55 +0000 (+0400) Subject: Ensured that encrypt and decrypt in test_ofb_noiv use physically different keys X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=bdf1a9ecff137aa64a65d90ca139c0797924bd6e;p=oss%2Fctypescrypto.git Ensured that encrypt and decrypt in test_ofb_noiv use physically different keys --- diff --git a/tests/testcipher.py b/tests/testcipher.py index 052193c..ae74d41 100644 --- a/tests/testcipher.py +++ b/tests/testcipher.py @@ -56,12 +56,15 @@ class TestEncryptDecrypt(unittest.TestCase): def test_ofb_noiv(self): data="sdfdsddfxx" - key='abcdabcd' - c=cipher.new("AES-256-OFB",key) + encryptkey='abcdabcd'*4 + decryptkey=encryptkey[0:5]+encryptkey[5:] + + + c=cipher.new("AES-256-OFB",encryptkey) enc=c.update(data)+c.finish() # See if padding is added by default self.assertEqual(len(enc),len(data)) - d=cipher.new("AES-256-OFB",key,encrypt=False) + d=cipher.new("AES-256-OFB",decryptkey) dec=d.update(enc)+d.finish() self.assertEqual(data,dec) if __name__ == '__main__':