【问题标题】:Brute Force Attack ( decryption ) AES蛮力攻击(解密)AES
【发布时间】:2017-03-07 15:51:11
【问题描述】:

我正在尝试编程蛮力攻击,想法是:

  • 我已经有了加密后的密文
  • 我有纯文本的前 4 个字母(即 41 个字符)
  • 我有密钥的前 12 个字符

我需要找到丢失的 4 个字符

假设我有钥匙:

 "ABCDEFGHIJ????"

我怎样才能应用暴力攻击来找到丢失的字符?

【问题讨论】:

标签: security encryption


【解决方案1】:

缺少 4 个关键字节有 2^32 种可能性。这适合无符号的 32 位 int。所以,循环这个无符号整数的所有可能性,从整数值中取出四个缺失的字节。在 C 中,是这样的:

unsigned int i = 0;

do {
    first candidate missing byte for key = i&255;
    second candidate missing byte for key = (i>>8)&255;
    third candidate missing byte for key = (i>>16)&255;
    fourth candidate missing byte for key = (i>>24)i&255;
    /* here: try the candidate with your AES encryption, break if it works */
    ++i;
} while (i != 0);

【讨论】:

    猜你喜欢
    • 2011-06-01
    • 1970-01-01
    • 2021-01-10
    • 1970-01-01
    • 1970-01-01
    • 2011-06-10
    • 1970-01-01
    • 1970-01-01
    • 2013-05-28
    相关资源
    最近更新 更多