Update utils.py

Allow to pass a SHA-OUT key, clean up and comments