Package de.das.encrypter.tools
Class ByteArrayWavEncloser
java.lang.Object
de.das.encrypter.tools.ByteArrayEncloser
de.das.encrypter.tools.ByteArrayWavEncloser
Byte array wav enclosers interweave the bits of the individual bytes of a
byte array with the bytes of the audio data of an audio file in WAV format.
The changes to the audio content are so minor that they are imperceptible to
the naked ear. Enclosed can be the bytes of a simple byte array or the bytes
of a file. The difference is that for the bytes of a file an additional
identifier with the original file name is attached. The bits of the data to
be hidden are hidden in the least significant bits of the volume values in
both stereo channels.
-
Field Summary
Fields inherited from class de.das.encrypter.tools.ByteArrayEncloser
HIDDEN_FILE_ID, ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]voidbreakIt()Set a flag that indicates to interrupt a running process immediately.booleanChecks if the capacity of the given audio file is sufficient to hold the given number of bytes.booleancanHoldFile(File f, File audio) Checks if the capacity of the given audio file is sufficient to hold the given file.voidbooleancontainsHiddenData(File container) booleancontainsHiddenFile(File container) intgetCapacity(File container) Calculates the maximum acquisition capacity of a given audio file under the condition that each volume value of both channels provide their LSB bit for the bits of the data to be woven in.byte[]getContainedBytes(File container, int count) intGet the amount of bytes hidden in the given file.getHiddenFileName(File container) voidWeaves the given data into the given audio file.voidbyte[]regainData(File container) Checks if the specified file contains hidden data and then starts to recover the data from the file.
-
Constructor Details
-
ByteArrayWavEncloser
public ByteArrayWavEncloser() -
ByteArrayWavEncloser
-
-
Method Details
-
canHold
Checks if the capacity of the given audio file is sufficient to hold the given number of bytes.- Parameters:
length- the number of bytes to bef- the file to be used as a container.- Returns:
- true, if the container is able to hold the data.
-
canHoldFile
Checks if the capacity of the given audio file is sufficient to hold the given file. Contrary to the capture of pure data, for files their name is still placed at the beginning.- Parameters:
f- the file to be woven into the container.audio- the file to be used as a container.- Returns:
- true, if the audio file is able to hold the file data.
-
getCapacity
Calculates the maximum acquisition capacity of a given audio file under the condition that each volume value of both channels provide their LSB bit for the bits of the data to be woven in.- Parameters:
container- the wav file to be used as the container.- Returns:
- the maximum acquisition capacity of the given audio file.
-
hideData
Weaves the given data into the given audio file.- Parameters:
d- a given byte array.container- a given audio file.- Throws:
Exception- when the specified audio file is not able to capture the given data.
-
hideData
- Throws:
Exception
-
containsHiddenFile
- Throws:
Exception
-
containsHiddenData
- Throws:
Exception
-
regainData
Checks if the specified file contains hidden data and then starts to recover the data from the file.- Parameters:
container- a given file assumed it contains hidden data.- Returns:
- the regained data or null, if the regaining process has been interrupted.
- Throws:
Exception- if any error occurs.
-
getHiddenArraySize
Get the amount of bytes hidden in the given file.- Parameters:
f- a given file.- Returns:
- the number of bytes hidden in the given file.
- Throws:
Exception- in case of any error.
-
assemble
- Throws:
Exception
-
clear
- Throws:
Exception
-
breakIt
public void breakIt()Set a flag that indicates to interrupt a running process immediately. -
getHiddenFileName
- Throws:
Exception
-
getContainedBytes
- Throws:
Exception
-