psypanda / hashID

Software to identify the different types of hashes -
http://psypanda.github.io/hashID
1.35k stars 183 forks source link

Make hashid.py usable as a python module #7

Closed bburky closed 10 years ago

bburky commented 10 years ago

Move argparse configuration and input processing into a main() function.

Example Usage:

In [1]: import hashid

In [2]: list(hashid.identifyHash('d41d8cd98f00b204e9800998ecf8427e'))
Out[2]: 
[('MD5', '0'),
 ('MD4', '900'),
 ('MD2', False),
 ('Double MD5', '2600'),
 ('LM', '3000'),
 ('RAdmin v2.x', False),
 ('RIPEMD-128', False),
 ('Haval-128', False),
 ('Tiger-128', False),
 ('Snefru-128', False),
 ('ZipMonster', False),
 ('Skein-256(128)', False),
 ('Skein-512(128)', False),
 ('Lotus Notes/Domino 5', '8600'),
 ('NTLM', '1000'),
 ('Domain Cached Credentials', '1100'),
 ('mscash', '1100'),
 ('Domain Cached Credentials 2', '2100'),
 ('mscash2', '2100'),
 ('DNSSEC(NSEC3)', '8300')]
psypanda commented 10 years ago

thank you for your contribution @bburky ! shouldn't the variables from line 10 to 15 also be included in main() ?

bburky commented 10 years ago

These lines? Probably doesn't matter. I wasn't sure if they were only used by the main code. Yeah, you could move those too.

I think it may be nice to move prototypes and hashcatModes to the top level though. Theoretically a program integrating this could override them and add to them or filter them down.

psypanda commented 10 years ago

You've got a good point there with the prototypes and hashcatModes modes, I'm currently not home (I'm on my mobile right now) so I cant change it myself, but if you create a pull request from the latest version on github I'll happily merge it in. For the variable lines, yes they are only used by the main code now since argparse moved to main() so I guess I could move them to main() too.