Skip to content

Instantly share code, notes, and snippets.

@manish-manghwani
Last active August 7, 2020 22:24
Show Gist options
  • Select an option

  • Save manish-manghwani/bda7120637e3cec6bfd83e3b1fc087c7 to your computer and use it in GitHub Desktop.

Select an option

Save manish-manghwani/bda7120637e3cec6bfd83e3b1fc087c7 to your computer and use it in GitHub Desktop.
#!/bin/sh
input=$(whiptail --inputbox "Encrypt input" 8 39 input --title "Encryption Utility" 3>&1 1>&2 2>&3)
selectedOption=$(whiptail --title "Utilities" \
--radiolist "Select Utility:" 10 80 3 \
1 bcrypt on \
2 Argon2i off \
3 Argon2iD off \
3>&1 1>&2 2>&3)
if [ $selectedOption = 1 ]
then
php -r "echo password_hash( '$input', PASSWORD_BCRYPT );"
elif [ $selectedOption = 2 ]
then
php -r "echo password_hash( '$input', PASSWORD_ARGON2I );"
else
php -r "echo password_hash( '$input', PASSWORD_ARGON2ID ) ;"
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment