Skip to content

Weak RSA Key Size (ARCH5117)

Key go.security.weak-rsa-key-size · Severity warning · Category security · CWE CWE-326

RSA keys below 2048 bits are no longer considered secure; modern compute can factor them, breaking the encryption or signatures.

func newKey() (*rsa.PrivateKey, error) {
return rsa.GenerateKey(rand.Reader, 1024)
}
func newKey() (*rsa.PrivateKey, error) {
return rsa.GenerateKey(rand.Reader, 2048)
}

Generate RSA keys with at least 2048 bits (preferably 3072+).