secret-scanning-custom-patterns icon indicating copy to clipboard operation
secret-scanning-custom-patterns copied to clipboard

SHA Family of Patterns

Open GeekMasher opened this issue 2 years ago • 1 comments
trafficstars

Name / Description

SHA Family hashing functions outputs

Sample Snippets

  • https://emn178.github.io/online-tools/sha1.html

True Positives

# SHA1
a94a8fe5ccb19ba61c4c0873d391e987982fbbd3

# SHA224
90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809

# SHA256
f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2

# SHA384
768412320f7b0aa5812fce428dc4706b3cae50e02a64caa16a782249bfe8efc4b7ef1ccb126255d196047dfedf17a0a9

# SHA512
ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff

False Positives

# contains a `w` but correct length
a94a8fe5ccb19bw61c4c0873d391e987982fbbd3

[optional] Propose Solution

[suggestion]

GeekMasher avatar Dec 12 '22 14:12 GeekMasher

Their length in characters is:

  • SHA1: 40
  • SHA224: 56
  • SHA256: 64
  • SHA512: 128

So their regex are:

  • SHA1: [A-Fa-f0-9]{40}
  • SHA224: [A-Fa-f0-9]{56}
  • SHA256: [A-Fa-f0-9]{64}
  • SHA512: [A-Fa-f0-9]{128}

Each will have the same before/after pair of \A|[^A-Fa-f0-9] and \z|[^A-Fa-f0-9]

aegilops avatar Feb 15 '23 15:02 aegilops