R1 - Challenge 1
R1 - Challenge 1
Theme: Steganography
Before covering how the audio steganography code works, it pays dividends to understand how audio is stored on
disk.
Digital audio works by sampling audio many times per second. Each sample is a signed value that describes a
normalised value between -1 and 1. Since this value is a signed integer, we can use steganography to store information
in the least significant bit. Commonly, audio is stored as 16-bit ¡±frames¡± at a framerate of 44.1KHz.
For audio steganography, the capacity of the stored data is given by the song duration multiplied by the sample rate,
divided by eight. E.G. for a three-minute song at 44.1KHz, we could encode 992,250 bytes using a least-significant-bit
method.
Solution code:
#! / b i n / python3
import s y s
import numpy
import wave
import s t r u c t
fname = s y s . argv [ 1 ]
waveform = [ ]
waveformParams = None
with wave . open ( fname , ¡¯ rb ¡¯ ) a s f :
print ( ¡±Width {} ¡± . format ( f . getsampwidth ( ) ) )
print ( ¡± Sampling Rate {} ¡± . format ( f . g e t f r a m e r a t e ( ) ) )
print ( ¡± Frames {} ¡± . format ( f . g e t n f r a m e s ( ) ) )
print ( ¡± Channels {} ¡± . format ( f . g e t n c h a n n e l s ( ) ) )
waveformParams = f . getparams ( )
waveform = f . r e a d f r a m e s ( waveformParams . nframes )
waveformLength = len ( waveform )
i f waveformParams . sampwidth == 2 :
f l o a t f o r m = s t r u c t . unpack ( ¡¯ h ¡¯ ? ( waveformLength / waveformParams . sampwidth ) ,
waveform )
15
else :
f l o a t f o r m = s t r u c t . unpack ( ¡¯ b ¡¯ ? waveformLength , waveform )
s t e g L e n g t h = waveformParams . nframes / 8
s t e g D a t a = numpy . z e r o s ( s t e g L e n g t h , dtype=numpy . u i n t 8 )
for i in range ( s t e g L e n g t h ) :
byteVal = 0
f o r s h i f t in range ( 8 ) :
t = floatform [ i ? 8 + shift ]
byteVal += ( t & 0b1 ) ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- you ve got mail
- cybersecurity zero to hero with cyberchef
- open source as fuel of recent apt hitcon
- malware initial findings report mifr 10127623 2017 10 13
- below are a few examples of the spear phishing email used
- joint cybersecurity advisory
- usb attack to decrypt wi fi communications
- the rise and fall of amsi black hat briefings
- maze ransomware
- threat profile jupyter infostealer
Related searches
- do the write thing challenge 2019
- speeches about challenge in life
- validation procedures q2 r1 step 4 2005
- accept the challenge synonym
- wellness challenge ideas
- other words for challenge myself
- word collect daily challenge answers
- synonyms for challenge myself
- synonym for challenge yourself
- challenge problems math
- 30 day wellness challenge ideas
- mental health challenge ideas