This update to re-search.py, my tool to search text files with regular expressions, brings several new regular expressions.
There are 4 new regular expressions for cryptographic hashes: md5, sha1, sha256, sha512. And one new name that groups these 4 regular expressions: hashes.
You can use it like this: re-search.py -n hashes sample.txt
These regular expressions not only match strings of hexadecimal characters of the appropriate length (with a boundary: \b), they also check each extracted hash with a Python function (HashValidate in re-extra.py) that is designed to eliminate strings that accidentally look like a hash (example: 32 times letter A).
HashValidate checks the following:
These simple rules are designed to detect hexadecimal strings that are too uniform, and thus probably not a hash digest.
And I also added regular expressions for strings delimited by single quotes: str-s, str-se str-su, str-seu.
re-search_V0_0_22.zip (http)Click to Open Code Editor