Advertisement
howtophil

Retrieve encrypted file from PNG (color code by pixels)

Dec 22nd, 2016
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.35 KB | None | 0 0
  1. #!/bin/bash
  2. #------------------------------------------------------------
  3. # To get file back from image
  4. #
  5. # $ ./fromcolor.sh imagefilename.png > restoredfile.name
  6. #
  7. # You will be prompted for your encryption key/passphrase
  8. # See matching tocolor.sh http://pastebin.com/jgXkjY78
  9. #
  10. # See update version of this script here http://pastebin.com/jCQMH5kW
  11. #------------------------------------------------------------
  12.  
  13. # while loop
  14. convert "$1" txt: | cut -f 2 -d'#' |cut -f 1 -d' ' | (
  15.     while IFS= read c
  16.     do
  17.         let counter+=1
  18.         case "$c" in
  19.             "000001") color="A" ;;
  20.             "000002") color="B" ;;
  21.             "000003") color="C" ;;
  22.             "000004") color="D" ;;
  23.             "000005") color="E" ;;
  24.             "000006") color="F" ;;
  25.             "000007") color="G" ;;
  26.             "000008") color="H" ;;
  27.             "000009") color="I" ;;
  28.             "000010") color="J" ;;
  29.             "000011") color="K" ;;
  30.             "000012") color="L" ;;
  31.             "000013") color="M" ;;
  32.             "000014") color="N" ;;
  33.             "000015") color="O" ;;
  34.             "000016") color="P" ;;
  35.             "000017") color="Q" ;;
  36.             "000018") color="R" ;;
  37.             "000019") color="S" ;;
  38.             "000020") color="T" ;;
  39.             "000021") color="U" ;;
  40.             "000022") color="V" ;;
  41.             "000023") color="W" ;;
  42.             "000024") color="X" ;;
  43.             "000025") color="Y" ;;
  44.             "000026") color="Z" ;;
  45.             "000027") color="." ;;
  46.         esac
  47.         if [ $color ]; then
  48.             echo -n $color
  49.         fi
  50.     done
  51. ) | tr '.' " " |codegroup -d |ccrypt -d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement