dongyang0005 2015-05-23 12:00
浏览 152

从openssl配置确定加密强度

I am a novice in the field of cryptography. Consider the openssl config param below.

$openssl_config = array(
                "digest_alg" => "sha512",
                "private_key_bits" => 2048,
                "private_key_type" => OPENSSL_KEYTYPE_RSA,
                "encrypt_key_cipher" => OPENSSL_CIPHER_AES_256_CBC 
            );

I just want to know the strength of encryption the we can get using the above config.

e.g. Is it 256 bit, 2048 bit, 512 bit? what is the criterion?

Thanks

  • 写回答

1条回答 默认 最新

  • drngnh708353 2015-05-23 21:20
    关注

    I just want to know the strength of encryption the we can get using the above config.

    "Encryption strength" is roughly measured in security levels. It allows you to compare different types of algorithms. There's a treatment of it at Security Level on the Crypto++ wiki.

    Effectively, a security level indicates how many operations are required to break an algorithm. This is both theoretical and practical. For example SHA-1 has 80-bits of theoretical security. That's because of birthday attacks on collisions. However, its close to 61-bits due to advances in cryptanalysis, like Marc Steven's attack from 2011. See Project HashClash for details.

    There are tables of equivalent security levels for Symmetric Key, Hashes, Finite Field, Integer Factorization and Elliptic Curves. Symmetric key is for block and stream ciphers, like AES, Camellia and RC4. Hashes is for hashing, like Whirlpool and SHA and HMACs. Finite field is for Diffie-Hellman and other related problems. Integer factorization if for RSA and other factorization problems. And elliptic curves is for EC based problems.

    You can find the NIST tables below. Other organizations that publish the criteria include NESSIE, ECRYPT, ISO/IEC.

    Here are the security levels of the algorithms you specified:

    • SHA-512 - 256-bits of security
    • 2048-bit RSA - 112-bits of security
    • AES-256 - 256-bits of security

    In theory, an attacker would attack the weakest component. So he/she would go after RSA since its the weakest crypto component. But in practice, I don't think it matters. The weakest component provides 112-bits of security, and that's out of reach for most adversaries.

    In practice, the adversary will probably find a vulnerability in your web server and get the secret while its at rest because the crypto is too hard.

    As an academic exercise, and since you selected AES-256, you would want the following to maintain 256-bits of security throughout the system:

    • AES-256 - 256-bits of security
    • 15000+ bit RSA - 256-bits of security
    • SHA-512 - 256-bits of security

    When a RSA modulus gets above 3072-bit or 4096-bit (or so), you usually switch to elliptic curves.

    If you wanted to maintain the minimum security level of 112-bits, then you would use:

    • 3-key 3DES - 112-bits of security
    • 2048-bit RSA - 112-bits of security
    • SHA-224- 112-bits of security
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog