加密强度不足

时间:2017-07-27 16:46:03

标签: java spring-security

Veracode报告了RSAkeyHelper中的漏洞。为此算法指定的密钥大小不足以保护其免受暴力攻击。根据补救注释,密钥大小应为2048位。您能否就修复或减轻此漏洞提供一些指导?

Jar:spring-security-rsa-1.0.3.RELEASE.jar 文件:RSAKeyHelper.java

static KeyPair generateKeyPair() {
    try {
        final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
        keyGen.initialize(1024);
        return keyGen.generateKeyPair();
    } catch (NoSuchAlgorithmException e) {
        throw new IllegalStateException(e);
    }

}

1 个答案:

答案 0 :(得分:0)

该行

keygen.initialize(1024);

正在设置密钥大小。将1024更改为2048或更高,应该使您符合规定。