Find use of weak cryptographic algorithms in Go

Proprietary

Finds Go calls into crypto/md5, crypto/sha1, crypto/des, and crypto/rc4. These algorithms are cryptographically broken and should not be used for security-sensitive purposes such as hashing passwords, generating signatures, or encrypting data. Prefer SHA-256 or stronger (crypto/sha256, crypto/sha512) and AES (crypto/aes).

org.openrewrite.golang.security.search.FindWeakCryptoAlgorithm
mod run . --recipe=org.openrewrite.golang.security.search.FindWeakCryptoAlgorithm

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Find method usages crypto/md5 New(..)
  2. Find method usages crypto/md5 Sum(..)
  3. Find method usages crypto/sha1 New(..)
  4. Find method usages crypto/sha1 Sum(..)
  5. Find method usages crypto/des NewCipher(..)
  6. Find method usages crypto/des NewTripleDESCipher(..)
  7. Find method usages crypto/rc4 NewCipher(..)