Guest User

Untitled

a guest
Nov 12th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. clip() {
  4. # sync clipboards
  5. xclip -o | xclip -sel clip
  6.  
  7. # print to stdout
  8. xclip -o
  9. }
  10.  
  11. audioSource() {
  12. # record 1 second of audio
  13. arecord -d 1 /tmp/rand.wav
  14. }
  15.  
  16. hmac() {
  17. # hmac of audio with random key -> base64 32
  18. hmac256 --binary $(openssl rand --base64 32) /tmp/rand.wav | base64 | cut -c 1-32 | xclip
  19. }
  20.  
  21. clean() {
  22. # cleanup
  23. rm /tmp/rand.wav
  24. }
  25.  
  26. main() {
  27. audioSource
  28. hmac
  29. clip
  30. clean
  31. }
  32.  
  33. main
Add Comment
Please, Sign In to add comment