-
Notifications
You must be signed in to change notification settings - Fork 0
/
HiddenSound.py
65 lines (62 loc) · 2.57 KB
/
HiddenSound.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#HiddenSound Ver 1.0
# Powered by IVUCB4T
# Hide your secret text in wave audio file.
import os
import wave
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-f', help='Select Audio File', dest='audiofile')
parser.add_argument('-m', help='Enter your Secret Message', dest='secretmsg')
parser.add_argument('-o', help='Your Output file path and name', dest='outputfile')
args = parser.parse_args()
af = args.audiofile
string = args.secretmsg
output = args.outputfile
arged = False
if af and string and output:
arged = True
def cls():
os.system("clear")
def help():
print("\033[92mHide Your Secret Message in Audio Wave File.\033[0m")
print ('''usage: HiddenSound.py [-h] [-f AUDIOFILE] [-m SECRETMSG] [-o OUTPUTFILE]
optional arguments:
-h, --help show this help message and exit
-f AUDIOFILE Select Audio File
-m SECRETMSG Enter your message
-o OUTPUTFILE Your output file path and name''')
def banner():
print ('''
╭╮╱╭╮╱╱╭╮╱╭╮╱╱╱╱╱╱╭━━━╮╱╱╱╱╱╱╱╱╱╱╭╮
┃┃╱┃┃╱╱┃┃╱┃┃╱╱╱╱╱╱┃╭━╮┃╱╱╱╱╱╱╱╱╱╱┃┃
┃╰━╯┣┳━╯┣━╯┣━━┳━╮╱┃╰━━┳━━┳╮╭┳━╮╭━╯┃
┃╭━╮┣┫╭╮┃╭╮┃┃━┫╭╮╮╰━━╮┃╭╮┃┃┃┃╭╮┫╭╮┃
┃┃╱┃┃┃╰╯┃╰╯┃┃━┫┃┃┃┃╰━╯┃╰╯┃╰╯┃┃┃┃╰╯┃
╰╯╱╰┻┻━━┻━━┻━━┻╯╰╯╰━━━┻━━┻━━┻╯╰┻━━╯
|___|v1.0 \033[1;91mIVUCB4T)'-')\033[0m
\033[92mVisit for more tutorials : www.youtube.com/@IVUCB4T\033[0m
\033[93mHide your text message in wave audio file like MR.ROBOT\033[0m''')
def em_audio(af, string, output):
if not arged:
help()
else:
print ("Please wait...")
waveaudio = wave.open(af, mode='rb')
frame_bytes = bytearray(list(waveaudio.readframes(waveaudio.getnframes())))
string = string + int((len(frame_bytes)-(len(string)*8*8))/8) *'#'
bits = list(map(int, ''.join([bin(ord(i)).lstrip('0b').rjust(8,'0') for i in string])))
for i, bit in enumerate(bits):
frame_bytes[i] = (frame_bytes[i] & 254) | bit
frame_modified = bytes(frame_bytes)
with wave.open(output, 'wb') as fd:
fd.setparams(waveaudio.getparams())
fd.writeframes(frame_modified)
waveaudio.close()
print ("Done...")
cls()
banner()
try:
em_audio(af, string, output)
except:
print ("Something went wrong!! try again")
quit('')