Pycryptodome: AES CBC mode Ошибка 65537 - PullRequest
0 голосов
/ 25 июня 2018

Мне нужно расшифровать данные с помощью AES в режиме CBC и заполнении нулями. Вот мой код (похож на тот, что в Документация ):

from Cryptodome.Cipher import AES
from base64 import b64decode
from Cryptodome.Util.Padding import unpad

key = b64decode('QkFDR0FubzR0WkdIUkp2WQ==')
iv = b64decode('zBN6M2DMdbAsLcSc')
ct = b64decode('Ie+LMEUM66aEDJkKI61i0+Frh/g9xA8Pb7FR1bVSLohl21V4BHo1ZH7BSNkClaPy/ejKw8r6lDFhUuIzu2JfNHn3W9h6sdM3ZiSniBNQP/dFrhrmc3I7xuZIvfTQqoyV6/DsFSZnyoObrCeF7Wi3VvPnNk9f3/PCQ2hAXPiA1soA05ALkGRgBPen8kxm8NEUTxogc8kSQ01P7/yvodKxn+iqmyG4x5CXOei7ePNovKxxj/c+xhVLm+Aaz2HundQ0zo0fmKBHUnAquzWzTTpRX1fq74XQdQG5gmv8XbiMac+KfyutbGiRU/nPPXPo5cPo9Ghkw++ZN8iApOdU5zXyXW0ChwvIrRmw7w0GFqNhX0JCdivmlnj2g3NhHvwKANgYn3lLOoNB+tOpQfQ/CVs6qzFzBDx2o6URpGwodEOuSIKMINCeQ/QmcosGdVOVMs4LvTwG2U88uUW2zt1elrt8q9NR5mSqJiX9YOVMEnLTms30eKLbJ3zwCMEzD/40bIcfwvdx1olx8x/HgB9flJT7fy0V3HCNwlLOejHUvTa9v8iB3hwwmK1691YR+LVzK1zD7xtBeyvhjeF69axdkW9yW+GLDqPop/TmjQ2mBvM/tch//cZEMU2gMEPd6m/RdK4TCMSrj9eUksdOCm4bF3m/h09PTw0VtwT313WF+YESNadz8Hm4+u0a87OADoPQ/psZ2RTLszIuQfkmMUPPW4XwWUDWFoVxjF6REq7gKF5qOyDJyi27EOnCC7LTIze7DZ1BlqrnmfYIQTGv+WKwqmF45txQyadYNcXA05GCd4u4PgbcB6hSZq9eMi9JNY/srz7SnTu2nb+UJ2DKV2KSXIl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V+RwZbzJup3guSnayZQreKm4BV7wTXUf9a+u9RMl88ddAZh9DrLZZGMvE2hpzTsihXHrYXKmfxNP/SA4Khy6ZpR8Bvfil4muOr')
cipher = AES.new(key, AES.MODE_CBC, iv)
pt = unpad(cipher.decrypt(ct), AES.block_size)
print("MSG:", pt)

Итак, вот мои вопросы:

  1. Если я запускаю его, я получаю эту ошибку: ValueError: Ошибка 65537 при создании экземпляра режима CBC . Это происходит, когда запускается строка 8 (cipher = AES.new (ключ, AES.MODE_CBC, iv), и я не знаю почему. Я видел другой Вопрос об этой ошибке, но там он попытался расшифровать ввод, который не был не заявлено, что здесь не так.
    Решено: Как сказал 'SquareRootOfTwentyThree', длина моего IV была неправильной ... Base64 кодирует 8b-6b. Я опубликую обновленный код с (новыми) вопросами под этим.

    from Cryptodome.Cipher import AES
    from base64 import b64decode,b64encode
    
    key = bytes.fromhex('42414347416E6F34745A4748524A7659')
    ct =b64decode('zBN6M2DMdbAsLcScIe+LMEUM66aEDJkKI61i0+Frh/g9xA8Pb7FR1bVSLohl21V4BHo1ZH7BSNkClaPy/ejKw8r6lDFhUuIzu2JfNHn3W9h6sdM3ZiSniBNQP/dFrhrmc3I7xuZIvfTQqoyV6/DsFSZnyoObrCeF7Wi3VvPnNk9f3/PCQ2hAXPiA1soA05ALkGRgBPen8kxm8NEUTxogc8kSQ01P7/yvodKxn+iqmyG4x5CXOei7ePNovKxxj/c+xhVLm+Aaz2HundQ0zo0fmKBHUnAquzWzTTpRX1fq74XQdQG5gmv8XbiMac+KfyutbGiRU/nPPXPo5cPo9Ghkw++ZN8iApOdU5zXyXW0ChwvIrRmw7w0GFqNhX0JCdivmlnj2g3NhHvwKANgYn3lLOoNB+tOpQfQ/CVs6qzFzBDx2o6URpGwodEOuSIKMINCeQ/QmcosGdVOVMs4LvTwG2U88uUW2zt1elrt8q9NR5mSqJiX9YOVMEnLTms30eKLbJ3zwCMEzD/40bIcfwvdx1olx8x/HgB9flJT7fy0V3HCNwlLOejHUvTa9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iJc7m1+ZGu2Q/VPfW1yqEYtJIBMEIXHA4qJ1IaU5tRfh2F3i6fKIOnD8bU0U82aE2Pq23/bUga4t84rhys4sskAUhEj/sWSCpiC8p1RTfuXQsvTfdW0AJ5mMZzOgFDqZ1YKOjp4cs0XknzJoj7jbisoiLv9AQZLeHSIEiqmSKLUiYgk6cOwuHVDafyCf2SudSPh5cnWck5RYdwUzWyxeuPhKO6knJnOJB6SDf99KZFbQz1xd2xo7Rk2PSkngOHSdfHfya5jj2jzLH1hmT5UzJfpLVxDGYVHRV+RwZbzJup3guSnayZQreKm4BV7wTXUf9a+u9RMl88ddAZh9DrLZZGMvE2hpzTsihXHrYXKmfxNP/SA4Khy6ZpR8Bvfil4muOr')
    iv = ct[:16]
    
    ciph = AES.new(key, AES.MODE_CBC, iv)
    res = ciph.decrypt(ct[16:])
    print(res)
    print(b64encode(res))
    
  2. Задача, которую я должен решить, гласит, что в сообщении используется нулевое байтовое заполнение (нулевое заполнение), и если я его запускаю, в конце я получаю нулевые байты. Так могу ли я предположить, что расшифровка прошла правильно? Дело в том, что я не могу прочитать секрет из сообщения.

Заранее спасибо!

Привет, SomeDude

...