So you cannot open the keygen? what do you mean by "not working"?
Try copy paste this in the terminal
/bin/bash -c "$(curl -fsSL [url=https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh]https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh[/url])" && eval "$(/opt/homebrew/bin/brew shellenv)" && brew update && brew install openssl