metalx1000

Encode and Encrypt and Hiding Messages

Oct 21st, 2024 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.10 KB | None | 0 0
  1. # Encrypt
  2. # The `-a` flag ensures the output is base64 encoded
  3. echo "This is my hidden message"|openssl enc -e -aes-256-cbc -a -salt -pbkdf2
  4. echo "This is my hidden message"|openssl enc -e -aes-256-cbc -a -salt -pbkdf2 -pass pass:password
  5.  
  6. # Decrypt
  7. echo "U2FsdGVkX1/T32yxN3lEyLOuj7CFnPtH7TOzmDYZ8tYfpDK+vtZTKnYAod8KXrMs"| openssl enc -aes-256-cbc -a -d -salt -pbkdf2 -pass pass:password
  8.  
  9. # Encode QR
  10. sudo apt install qrencode
  11. qrencode -h
  12.  
  13. echo "This is my message"|qrencode -t png -o image.png
  14. echo "This is my message"|qrencode -t UTF8
  15. echo "This is my message"|qrencode -t ASCII
  16. echo "This is my message"|qrencode -t ASCIIi
  17.  
  18. # Decode QR
  19. sudo apt install zbar-tools zbarcam-gtk
  20. zbarimg image.png
  21. zbarimg --quiet image.png
  22. zbarimg --quiet --raw image.png
  23.  
  24. # Encode Base64
  25. echo "This is my message"|base64
  26. base64 -w0 image.png
  27. base64 image.png
  28.  
  29. # Decode Base64
  30. echo "VGhpcyBpcyBteSBtZXNzYWdlCg==" |base64 -d
  31.  
  32. # Encoding/Encrypting/hiding
  33. # create text file
  34. echo "This is a text file
  35. I am writing you a message
  36. Nothing hidden here
  37. Everything is normal
  38. Please move Along." > msg.txt
  39.  
  40. cat msg.txt
  41.  
  42. stegsnow -C -m "This is my hidden message" -p "password" msg.txt hidden_msg.txt
  43. cat msg.txt
  44. cat hidden_msg.txt
  45. gedit hidden_msg.txt
  46. vi hidden_msg.txt
  47. neovim hidden_msg.txt
  48.  
  49. # Decode/Decypt/Reveal message
  50. stegsnow -C -p "password" hidden_msg.txt
  51.  
  52. # Audio Encoded text
  53. sudo apt install minimodem
  54. #transmit (110 is the baud rate - higher faster but less accurate)
  55. echo "This is my message"|minimodem --tx --ascii 110
  56.  
  57. #recieve
  58. minimodem --rx --ascii 110
  59.  
  60.  
  61. # Morse Code Encoding
  62. # morse is to encode
  63. # morse2ascii is to decode
  64. sudo apt install morse morse2ascii
  65. echo "This is my message"|morse
  66.  
  67. morse2ascii data.wav
  68.  
  69. # morse code in ascii dots and dashes
  70. echo "This is my message"|morsegen -
  71.  
  72. # barcodes
  73. echo "This is my message"|barcode |convert - -trim +repage msg.jpg
  74. zbarimg --quiet --raw msg.txt
  75.  
  76. # combining things we have learned
  77. # Encrypt/Encode
  78. stegsnow -C -m "$(echo "This is my hidden message"|openssl enc -e -aes-256-cbc -a -salt -pbkdf2 -pass pass:password)" -p "password" msg.txt hidden_msg.txt
  79. cat hidden_msg.txt|compress|base64
  80.  
  81. # Decrypt/Decode
  82. echo "H52QVNCkmQNiIIgwIOiUwUMHhJk0bMokAEERxESLCS5eVJDkYBsQd+SkoZPGzRkQed7UOQiiTZk5
  83. c8KckViR4kWbOCverLmzogInb+gINAlCIBkyZdwULSOnTE2LT3dm1HlTQRE7TPMILXnSoJs3ctqE
  84. YZMTalSdZXuWVQAlYpg5Ttu8wQoiCJs3Jl2oNSu1LFoFE3tO9Wu2cE61CggHPgu1L9qqhW8K5ql2
  85. cU/APNE2forTMmcQiQmL5quY896qjhlnNr1aM2rWkyljfE06rWPEqU9rbs1bN8XQpTEGH90XuOHN
  86. u3nv9q26JmbWyYl/Th35N1XoyJvP9tl8sOjY2g3vDC15egIF"|base64 -d|uncompress > new_msg.txt
  87. echo "$(stegsnow -C -p "password" new_msg.txt)"|openssl enc -aes-256-cbc -a -d -salt -pbkdf2 -pass pass:password
  88.  
  89. # JUST FOR FUN
  90. # Let's hide things ourselves in a very interesting way
  91.  
  92. # hide message
  93. echo "This is my message"|qrencode -t ASCII|tr "#" "."|tr " " ","|tr "\n" "'"|while read -n1 c
  94. do
  95.   echo -n "$(shuf /usr/share/dict/words|head -n3|tr "\n" " "| tr -d "'"| tr -cd '[:alnum:]')$c"
  96. done|tr "'" "\n"> nmsg.txt
  97.  
  98. # show qrcode for scanning
  99. cat nmsg.txt | tr -d '[:alnum:]'|tr "," "#" |tr "." " "
  100.  
  101.  
Add Comment
Please, Sign In to add comment