Advertisement
howtophil

Encrypt to speech (ccrypt/codegroup/espeak/avconv)

Dec 19th, 2016
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.79 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #--------------------------------------------------------------------------------------------
  4. # Use:
  5. # echo "Some message" | ./tospeech.sh "The KeY tO EnCryPt by"
  6. # cat somefile.doc | ./tospeech.sh "The KeY tO EnCryPt by"
  7. #
  8. # Q. How do you decrypt?
  9. # A. Listen to the mp3. Type in the letters as they are spoken.
  10. # (Alpha is 'A' Bravo is 'B' etc. ALL CAPS)
  11. # Make sure to type spaces between every 5 letters.
  12. # Save as text file. Then run this command:
  13. # $ codegroup -d typedtext.txt | ccrypt -d -K "The KeY EnCryPteD by" > somefile.doc
  14. #
  15. #--------------------------------------------------------------------------------------------
  16.  
  17. ccrypt -K "$1" | codegroup | tr '\n' ' '| (
  18. #--------------------------------------------------------------
  19. #bzip -9 | ccrypt -K "$1" | codegroup | tr '\n' ' '| (
  20. #codegroup | tr '\n' ' '| (
  21. #--------------------------------------------------------------
  22.     # while loop
  23.     while IFS= read -r -n1 c
  24.     do
  25.         case "$c" in
  26.             A)  echo -n "Alpha " ;;
  27.             B)  echo -n "Bravo " ;;
  28.             C)  echo -n "Charlie " ;;
  29.             D)  echo -n "Delta " ;;
  30.             E)  echo -n "Echo " ;;
  31.             F)  echo -n "Foxtrot " ;;
  32.             G)  echo -n "Golf " ;;
  33.             H)  echo -n "Hotel " ;;
  34.             I)  echo -n "India " ;;
  35.             J)  echo -n "Juliet " ;;
  36.             K)  echo -n "Kilo " ;;
  37.             L)  echo -n "Lima " ;;
  38.             M)  echo -n "Mike " ;;
  39.             N)  echo -n "November " ;;
  40.             O)  echo -n "Oscar " ;;
  41.             P)  echo -n "Papa " ;;
  42.             Q)  echo -n "Quebec " ;;
  43.             R)  echo -n "Romeo " ;;
  44.             S)  echo -n "Sierra " ;;
  45.             T)  echo -n "Tango " ;;
  46.             U)  echo -n "Uniform " ;;
  47.             V)  echo -n "Victor " ;;
  48.             W)  echo -n "Whiskey " ;;
  49.             X)  echo -n "X-ray " ;;
  50.             Y)  echo -n "Yankee " ;;
  51.             Z)  echo -n "Zulu " ;;
  52.             " ")  echo -n ". " ;;
  53.         esac
  54.     done
  55. ) | espeak --stdin -v en-gb --stdout | avconv -y -i - test.mp3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement