Introduction

Digital information is lossless. You can copy a file from hard disk to floppy to CD to flash stick to ... and it will still be the same file. But if you use analog media, such as good old tape, you can rely on the opposite: The data you read from the medium will definitely be different from what you wrote onto it.

Anyway, there are many ways to hide secret information in the sound on an audio tape. I'll explain a quite simple one. All you need to do, before you can try it, is to take a tape recorder, connect its microphone port to the headphone (or line-out) port of your computer, and the microphone (or line-in) port of the computer to the recorder's headphone port.

The Idea

After recording a sound onto an audio cassette, and re-recording it into a Wave file, we cannot rely on the binary data to be the same or in any way similar. So, changing a few bits is not enough anymore. We have to change the sound in a way we can recognize, even behind loads of noise and arbitrary changes.

Your first idea may be to insert a very short beeeep every n seconds, where n is a byte from the secret message. The recipient can extract the noises with a band pass filter, put the intervals into a stream, and just read the message from it. But trying that, you'll soon run out of tape:

A = 65
B = 66
C = 67
ABC = 65 + 66 + 67 = 198

Inserting a recognizable frequency in intervals that stand for the hidden bytes, we would need 198 seconds only for a short message like ABC.

Your second idea may be to split each secret byte into high and low half-byte, so that the maximum interval between two beeps is 15, and no byte can fill more than 30 seconds on the tape. For example, the character "z", that would block 122 seconds by the first try, needs only 17 seconds this way:

z = 122 = 1111010
half bytes = 7 (0111) and 10 (1010)

That is exactly what this article's application does. It allows you to search the carrier wave for an unused or low-volume frequency, and inserts very short, hardly hearable noises of just that frequency. You can then play the result, and record it with the tape recorder. To extract the hidden message, you just play the tape, record the sound with an audio recorder software (such as GoldWave etc.), and remove the silence from beginning and end. Then you can open the file with this application, enter the frequency that had been used for hiding, and watch as a band pass filter isolates the beeps and your message gets re-constructed.

How it Works

Hide a Message

While hiding a message, the user performs five steps:

Select a Wave file, and enter the secret message.

Check if the message fits into the sound, and shorten it, if necessary.

Guess a frequency that occurs only in low volume, or not at all.

If "Check sound" produces a warning, raise the threshold volume or frequency until the warning disappears.

Write the new sound.

Play the new sound, and record it onto the tape.

Steps three and four are not self-explaining. Let's start with step three: Checking a frequency for existence and maximum volume. The user guesses a frequency and clicks the "Check sound" button. To check if the highest amplitude of such a frequency is lower than the selected volume value (that means, we can use the selected combination), we first have to isolate the frequency with a band pass filter. SoX does that for us. Then we compare the result's samples to the selected maximum amplitude (call it volume, that's nearly the same in this case), and count the samples that are too loud.

The short piece of code above calls two important methods, PrepareMessage and InsertBeep. PrepareMessage takes the stream with the secret message, and splits each byte in two half-bytes. The interval between two beeps cannot be zero seconds, but some half-bytes may be zero, so every value in the prepared stream will be halfByte + 1. Later on, the extracting method will have to subtract 1 from every interval, to get the original half-bytes.

What are we waiting for? We have the sound, the prepared messages stream, and a useable frequency. That's all we need to insert little noises at the specific seconds, which is the job of CreateBeep and InsertBeep.

After Hide has finished the while-loop, the complete message stream has been beeped into the sound. If you chose a fitting frequency an a not too high amplitude, it is hardly hearable (if not, it can still seem as usual noise to the average human ear, when played on average hardware). You can save the result to a .wav file, or play and record it without saving.

Extract a Message

Before reading a hidden message, the user has to filter the recorded sound. If the tape player added very bad noise in just our frequency, so that wrong beeps are detected, those errors can be deselected.

Enter the frequency of the expected beeps, and band pass filter the sound. The second filter button - threshold volume - is not really necessary. You can use it to remove samples from the graphic, that will anyway be treated as silence.

Find the noises. A beep is a group of samples that are greater than the selected threshold volume. In the graphic, the beginning and end of each detected beep are marked with red lines. The CheckBoxes allow you to exclude single beeps from evaluation, if you're sure that they don't belong to the message.

Read the message. The last step lists the intervals between the selected noises, and re-constructs the hidden message.

"Filter sound" applies the same band pass filter we already know. This time, we don't count big samples, but open and display the filtered wave.

Every beep is 1/32 seconds long. That's not much for human ears, but it's a lot of samples. The groups of samples are separated by silence (due to band pass filter and threshold volume), so we can move a scan window over the samples, and define a piece of silence as all samples in the current time window are below the threshold. Samples above the threshold are treated as parts of one beep, if there is no silence between them.

It could be done in .net 1.1, but it would need a lot more lines and stupid coding time. Just think of all the generic collections... do you really want to generate a type safe collection for each one?

_________________________________
Please inform me about my English mistakes, I still try to learn your language!

I have read here all the confusion about frequencies
availables for hiding beeps and so on. But all of you
are missing somthing. Using a standard sound card, the
highest frequency you can output is 22050 Hz, and no
more, as the maximum sample rate usually is
44100 samples / sec. Of course, if you use a special
card you can do more.

About tape, allmost all amateur equipment has different
low and high frequency limits, and the high freq.
depends on the head azimuth adjustment (a small screw let
users adjust that in many tape recorders). But I dont
recommend that you do that unless you know well...

Hi Human
Well, the answer to that question depends, strictly speaking, on the format of the file. But you can always save anything you want to a file. The problem lies in the hardware of the sound card. That hardware is designed to work for frequencies up to 20000, and to avoid antialising errors there must be a low pass filter. The teorethical maximum frequency is half the highest sample rate, and the highest sample rate in common sound cards is 44100 (same freq used in audio CD). Yo may have a higher quality card that samples up to 48000 or may be more. Professional sound cards sample much higher but I dont know how much.

You can sinthetize any wave you want and write it to a file. In the moment of playing the file is where the max. freq. is an issue. The file format may say, for example, that the sample rate of the file is 10000. But if you write the software you can o what you really want.

In average hearing goes up to 20 khz , and you need at least 2 samples to reproduce any frequency, and as people said standard digital equipment samples at 44.1khz and better quality at 48khz or maybe higher, assuming you use the best sampling rate avaiable, but analog equipment as tape recorders are a very different thing, many/most of them do not work well at 20khz and the tape itself plays an important part in the quality ( normal vs metal tapes ) other analog medium maybe the phone line which max frequency is near 4khz. This reminds me of modems that use 'phase shifting' to modulate data.

Now, what about stereo audio? , you could split the message for each channel ? on sampling some oldest 8bit digital cards used to sample each channel at half the frequency but current 16+ bit cards double the frequency ( 88.2khz and 96khz )
Another way of adding more information may be using smaller interval perhaps multiples of 200ms instead of 1 second,

great and very interesting series ! & remember that an clean desk/office/lab is the result of an empty mind. lol

or you could encapsulate it in the mass media.. that seems to be ridiculously fast.. although you would probably end up like the guy in A Beautiful Mind, but i guess it's a small price to pay in the name of.. i dunno.. cool things to do.

also it would be pretty hard to decrypt or whatever, and nearly impossible to implement, but im guessing you're halfway there...

After some research, the frequency range of a audio cassettes is variable and it's depending on the type of the audio casettes... but i could not find any exact information about the supported frequency range...

I'm sure that that the most sound-cards and digital audio formats support them...

So you can hide messages with high or low frequencies in any digital audio formats without any heardible changes...

So i will test it in the next week...

this all lines are only litte hints and insperations and not a review of your concept and work...

So you have to test the bandwidth of the cassette, before you can encode the message. Great! Always use the kind of tape with the highest/lowest possible frequency. If somebody tries to copy it onto a different cassette, the frequencies will go lost, that means, the message won't survive unexpected copying by a spy.

_________________________________
Please inform me about my English mistakes, I still try to learn your language!

I believe that's the greatest supported bandwith comes with (i call it) "cd tapes"... They are the best choice (to get the best quality) by copying a cd to tape...

Another advantage is that you can inserting more beeps without any heardible changes...

When this concept works so we can try another idea:

We have four different beeps (in four different frequencies):

- The first beep (f.e. 22000hz) standing for the beginning of a byte...
- The second beep (f.e. 23000hz) standing for the end of a byte...
- The third beep (f.e. 24000hz) standing for a 0 bit...
- The fourth beep (f.e. 25000hz) standing for a 1 bit...

So we inserting a permanent tone consisting of this 4 frequencies to hide our message...

it's not time based and we can hide very long messages...

but for this scenario it's better to implement a own highpass filter in c# to perform this operation simultaneous and in realtime...

Then it's possible to extract the hidden message without to record the wave to disk...

Good work as always, I don't personally have a use for this stuff but it's very fascinating to read about and I've always been especially interested in anything that integrates something non-computer and physical (audio tape) with software.

These are stand out articles on CodeProject, keep up the good work!

"A preoccupation with the next world pretty clearly signals an inability to cope credibly with this one."