Last active
November 13, 2018 00:53
-
-
Save rgruesbeck/4cb042dabe7d2ecda10590dfba9516f4 to your computer and use it in GitHub Desktop.
get random strings from your mic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
clip() { | |
# sync clipboards | |
xclip -o | xclip -sel clip | |
# print to stdout | |
xclip -o | |
} | |
audioSource() { | |
# record 1 second of audio | |
arecord -d 1 /tmp/rand.wav | |
} | |
hmac() { | |
# hmac of audio with random key -> base64 32 | |
hmac256 --binary $(openssl rand --base64 32) /tmp/rand.wav | base64 | cut -c 1-32 | xclip | |
} | |
clean() { | |
# cleanup | |
rm /tmp/rand.wav | |
} | |
main() { | |
audioSource | |
hmac | |
clip | |
clean | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment