Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gr3yc4t committed Feb 25, 2019
1 parent 39976b0 commit 9e88180
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ♪ Midi Password Generator ♪
> The script uses a key derivation function to extract a cryptographic key from an array of MIDI notes, fetched in real-time.
### Dependencies
The script uses the <a href="https://pypi.org/project/python-rtmidi/">python-rtmidi</a> library that requires (on Linux) the following libraries
* build-essential
* libasound2-dev (For ALSA support)
* libjack-jackd2-dev (For Jack support)

To install them execute
```
sudo apt-get install build-essential
sudo apt-get install libasound2-dev #Just for ALSA
sudo apt-get install libjack-jackd2-dev #Just for Jack
```
After that you need to install the following python dependencies
* <a href="https://pypi.org/project/rtmidi-python/">rtmidi-python</a>
* <a href="https://pypi.org/project/hashlib/">hashlib</a>
* <a href="https://pypi.org/project/progress/">progress</a>
* <a href="https://pypi.org/project/argparse/">argparse</a>
```
sudo pip install hashlib progress argparse python-rtmidi
```

Tested only on Ubuntu 18.04, for other OS support read the <a href="https://spotlightkid.github.io/python-rtmidi/installation.html">rtmidi installation page</a>

### Usage
Batch parameter
```
usage: main.py [-h] [-p PORT] [-m MIN_NOTE] [-s SALT] [-f FUNC] [-r ROUND]
Generate password through MIDI
optional arguments:
-h, --help show this help message and exit
-p PORT, --port PORT Midi port
-m MIN_NOTE, --min-note MIN_NOTE
Minimun notes to play
-s SALT, --salt SALT Salt used in the key derivation function
-f FUNC, --func FUNC Key derivation function. Possible values : "pbkdf2",
"scrypt"
-r ROUND, --round ROUND
Round to use in the key derivation function (Only in
pbkdf2 mode)
```
In case no argument is passed, the script asks for input interactively.
### How does it work
The script simply fetches MIDI events in real time, and store every note ("note on" event in particular) in a buffer, that in the end is passed througth the <a href="https://en.wikipedia.org/wiki/PBKDF2">PBKDF2</a> key derivation function along with a used defined salt.

0 comments on commit 9e88180

Please sign in to comment.