Pages: [1] 2   Go Down
Author Topic: Crazy idea but bear with me - using sound for data transmission  (Read 2996 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys,

This is my first time playing with electronics but I'm trying to push the limits of my imagination.

My idea is that I can use a teensy/arduino to record from the PC speaker output.

What I will be recording is an audio representation of a data file (say a word/txt document or something).

I can choose the way the file is represented in audio so I guess the limitation is with the teensy. I'll obviously prefer to store the stream (microSD) at the fastest possible rate without introducing errors.

I can then plug the SD card into another machine and decode the stream to get a copy of the original file.

This method will allow me to export data from a machine that explicity prevents USB storage devices (i work in the IT security field so no need to worry).

Where to start? Can the teensy/arduino record audio? Are there any pre made libraries for this? Can I configure the bit rate of the recording?

Any sample code that I should be reading? Please point me in the direction.

How do I wire a PC Line out to the arduino? Will I need some sort of amp before inputting to the arduino or will the Line out be "loud" enough?

Many thanks in advance and apologies if this has been asked before
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Where to start? Can the teensy/arduino record audio? Are there any pre made libraries for this? Can I configure the bit rate of the recording?
There is a wave shield for arduino on a market, search on google. Code examples should be included, and I think you can tweak a bit rate for your convenience.  I just wonder, if usb isn't allowed, how you suppose to install -run a software application that would convert data to sound?
Technically, it's feasible,  I know a system that encode a data stream into stereo-phase difference, so everybody hear a music playing on PC, except one person, who is receiving an instructions. smiley 
Logged

Seattle, WA
Offline Offline
Full Member
***
Karma: 1
Posts: 174
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Heh.  Obviously someone who missed out on the joy of saving programs to audio tape in the '80s <g>.  Just sayin'...

Very much possible.  Painful, finicky, slow, and annoying, but quite possible smiley
Logged

Boston, MA
Offline Offline
Full Member
***
Karma: 0
Posts: 129
Batteries? We don't need no steenking batteries!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds suspiciously like a modem to me ;-) Everything old is new again! There's actually been a resurgence lately in data-over-audio and old acoustic modulation schemes thanks to certain locked-down hardware companies wanting a cut of everyone's action. Have a look at the papers and source code of HiJack, an open-source design for laundering data through the iPhone/iPad headphone jack without paying "Made for iPhone" extortion. They report some 8kbit/sec over it.

The but-how-do-I-encode-audio-if-I-can't-load-software problem is likely solvable too. A web-hosted conversion app (assuming there is some kind of network access) would work, although an internet link suggests easier ways of moving data ;-) Even without internet, the machine likely has MSIE, some other web browsers (javascript), WSH, Python or some other scripting language installed that could be used for this in a desperate case.

That said, I have seen several other crude data-moving tricks from locked-down machines - one faked a USB keyboard and encoded the data in USB HID control packets (used for stuff like toggling the Caps Lock, repeat rate / etc.). Heck, one used a plain non-USB keyboard and literally toggled the data out on the CapsLock/NumLock/Insert LEDs.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys that some great advice thanks.

For those asking how im going to get my data-->audio converting program onto the system. I can use the teensy as a keyboard. I can encode the executable binary into hex and then transfer it using keystrokes. VB will then be used to convert back from hex to binary. Check the end of this blogpost from a guy called David Kennedy --> http://www.secmaniac.com/august-2011/arduino-hacking-for-the-big-boys/

If executables are whitelisted on the machine then im sure this can be coded fully in VB?

That said, I have seen several other crude data-moving tricks from locked-down machines - one faked a USB keyboard and encoded the data in USB HID control packets (used for stuff like toggling the Caps Lock, repeat rate / etc.). Heck, one used a plain non-USB keyboard and literally toggled the data out on the CapsLock/NumLock/Insert LEDs.
Link???I've considered the CAPS/SCROLL/NUM lock method but have decided that with only 3 bits to toggle im limited in how fast i can transfer.

I didn't realise the HID protocol offered more options with control packets, maybe I should re investigate this? (After all, an all in one keyboard emulation tool that injects malicous code then uses the same 'keyboard' to capture the exported data would be perfect).

If you have any links on outputting using HID that would be great. I've scoured the web but haven't found anything yet.
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've done some work on code to isolate and detect a single frequency tone from an audio input, using correlation techniques. There's a research project called Digital Voices that has done quite a bit in this area, mainly for communicating small data packets to mobile devices with microphones, i.e. smartphones:

http://www.ics.uci.edu/~lopes/dv/dv.html

Someone else at Dorkbot Bristol has written this:

http://www.jarkman.co.uk/catalog/robots/tinydigitalvoices.htm

It's basically how modems work, but the data can be made to sound like R2D2, bird song and crickets.
Logged

Boston, MA
Offline Offline
Full Member
***
Karma: 0
Posts: 129
Batteries? We don't need no steenking batteries!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't remember where I saw these, sorry. The data-over-keyboard-LEDs method in particular was ages ago.

While I am thinking about the latter though... there was a very early 'computerized' (Timex?) wristwatch that could be synced with a PC via a special program that flickered the PC screen between black and white rapidly while the watch (with embedded photosensor) was held near it. Probably slow as hell unless you use multiple photodiodes / amplitude / color modulation or something more clever (cellphone video of QR Codes?), but commandeering the screen via e.g. a Javascript-capable browser may be easier than getting access to the speakers.
Logged

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A phone uses DTMF tones to dial up a number. Each tone represents a different number, so it's pretty much data transfer.
Logged

Andrew K.

Alfeld (Leine) / Germany
Offline Offline
Full Member
***
Karma: 9
Posts: 210
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

thats not true, you can always split up the data packets.
or, you could -- e.g. send the decimal values of an byte number for number over -- smiley-grin
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What other sort of data are you expecting to find in a binary datastream that "numbers" would not be suitable method for transfer of?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whether you're sending 4 bit characters or 8 bit characters doesn't effect your data rate, whether you're sending an 8 bit char, a 4 bit "number" or 4 boolean values your transfer rate will still be XYZ bps.  If you're willing to restrict your character set you could just as easily send 4 characters with 5 DTMF tones and get nearly twice the symbol rate of 8 bit chars.

In the end whether a method is appropriate or not really comes down to the throughput (in bps) required for the application, or issues related to the transport (like error correction, or w/e)  Whether the data to be transferred is "numbers" ASCII, or MP3 files is irrelevant.

I just feel like saying "numbers only" is misleading, where it really is entirely other factors that make it not an ideal encoding method.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I am transmitting at 14 bps for example, at the end of 10 seconds I will still have exactly the same amount of data, regardless of whether I transmit 4 bit characters or 8 bit characters.  I could transmit 32bit floats over the same transport and I would still be transmitting at 14 bps.

A DTMF tone is a "packet" that holds 4 bits of data, I'm curious how you think I'm misunderstanding it.

Quote
If you can fit even the 26 letters in common English usage (not counting numbers or punctuation) into the 16 DTMF symbols, recommend contacting a patent attorney immediately to apply for protection of your intellectual miracle.

If you can fit the "number" 242 into a single DTMF tone then perhaps you should do the same.

Bits are bits, and it doesn't matter what those bits represent.  Your transfer rate is entirely dependent on how many DTMF tone bursts you can send per unit time, not if they are to be interpreted as numbers or letters.  If you are only transmitting 4 bit "numbers" then it's true you will get twice as many symbols across per unit time, but those N 8 bit values, or N*2 4 bit values represent exactly the same amount of data (N*8 bits).


--edit--

I just realized that instead of "numbers" you probably actually mean "digits" as in the 0-9 that we typically use the DTMF to represent, but the data/bits argument still stands.
« Last Edit: September 02, 2011, 10:19:22 pm by extent » Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys;

I would like to give my 2 cents here. 

There goes.  DTMF is numbers only. 0 to 9.   ASCII is a an 8 bits code from 0 to 255 So let say that I what to send a letter A and the ASCII is 41 Hex --> 65 decimal, so you send tone for 6 and tone for 5, in this way, you can send a full ASCII text file over the "wire" and receive back like "de-tone" for 6 and "de-tone" for 5, so you have the number 65  and convert to ASCII.

My 2 cents
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 167
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

True, my first modem was a 28.8, never got too far into the nitty gritty of dial up systems before we were on to DSL.

but I've not once mentioned baud rate, only data rate (gross data rate in that wiki) and references to bit/sec.  

Nothing about baud rates makes DTMF less appropriate for any kind of data transfer.  It's not a good choice because it is slow, and it is equally slow for all types of data (gross bit rate).  There are no invisible boundaries based on the size of your symbol to the type of data you want to send.

For someone who just realized that you can encode data into an audio waveform I don't think it's a bad idea to look academically at DTMF.  Being able to abstract both the symbols and the data to bits doesn't seem like a bad thing, and DTMF is a nice approachable example.  (Don't want anyone to get stuck on the "how do I transfer my Int over serial, it can only send 1 bit at a time!!!" question)
Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For someone who just realized that you can encode data into an audio waveform I don't think it's a bad idea to look academically at DTMF.  Being able to abstract both the symbols and the data to bits doesn't seem like a bad thing, and DTMF is a nice approachable example.  (Don't want anyone to get stuck on the "how do I transfer my Int over serial, it can only send 1 bit at a time!!!" question

I agree with you, it is slow way to send data. I think the PO try to convert ASCII text file into MP3 file. And from MP3 file into ASCII file.  My feeling... Heh, that sound a good idea ...
Logged

Pages: [1] 2   Go Up
Jump to: