Skip to content

CLI program for generating hash values for files or strings (i.e. passwords).

License

Notifications You must be signed in to change notification settings

Mouhab-dev/Hashy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Hashy Python version platform

CLI program for generating hash values for files or strings (i.e. passwords).

Table of contents

General info

This project is a CLI (Command Line Interface) to hash individual files, compare between two files for integrity check or hash strings.

Libraries

Project is created with:

  • hashlib library.
  • argparse library.
  • python 3.6 or higher.

Setup

To run this project, install all the required libraries first then run the python script:

$ pip install hashlib
$ pip install argparse
$ python hashy.py -hf (hash functions) [-f <file path> | -cf <file path> <file path> | -s <string>]

Usage

Run the following command to display help message

hashy.py -h

or

hashy.py --help

A help message will appear with all required arguments the program needs to run:

usage: hashy.py [-h] [-v] -hf MD5:SHA1:blake2b [MD5:SHA1:blake2b ...]
                (-cf <file path> <file path> | -f <file path> | -s "String")

Hashy is a CLI program to hash files, compare two files (integrity check),
strings.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         display current version of Hashy
  -hf MD5:SHA1:blake2b [MD5:SHA1:blake2b ...]
                        the required hash function.
  -cf <file path> <file path>
                        check hash of two files for a match using the provided
                        hash function.
  -f <file path>        calculate hash for a file using the provided hash
                        function.
  -s "String"           calculate hash for a string using the provided hash
                        function (string inside " " is recommended).

Find me on Github: https://www.github.com/Mouhab-dev
  • -hf is essential for the script to run
  • -cf / -f / -s : only one of the previous arguments followed by the appropriate input is required to run the script.

Test

Tested with a string being hashed with md5,sha1 and sha256 algorithms:

C:\Users\<current user>\Desktop> python hashy.py -hf md5 sha1 sha256 -s "hello world it's hashy here" 
Hashing string ...

Algorithm:         Hash value:
------------       --------------------------------------
md5                ba672a8326b0d3333c7296e73e0ec0ed
sha1               2e561e67dfe68f64d63204c7e96f0dccaec5cb00
sha256             eb43f53ec1b2d25c0361574e99b4257a5a84d123f7e265e0434e03789276d460

Process Finished

About

CLI program for generating hash values for files or strings (i.e. passwords).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages