Tempest For Eliza (c) 2001 by Erik Thiele fm player (c) 2004 by Martin DvH This program uses the GPL license. see the file COPYING for details. a very important passage will be pasted here, too.: NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. this means if you get an electric shock from an old radio or crash your aircraft because of radio signals, it is YOUR problem! ok. now to the more interesting but less important topics: What is it ? ------------ Tempest for Eliza is a Program that uses your computer monitor to send out AM or FM radio signals. You can then hear computer generated music in your radio. this document first describes tempest for eliza, the old program that plays music like your cellphone does when you get a phonecall. then it describes tempest for mp3 which you can use to play mp3 files and receive them with you AM receiver:-) Then it describes tempest_for_mp3_fm which you can use to play MP3 files and receive them with you FM receiver ;-) How does this work ? -------------------- All electronic devices send out eletromagnetic waves. so does your monitor. and your monitor does it all the time. and at very high frequencies. high enough for your short wave AM radio. all you have to do is display the "correct" image on your screen and your monitor will emit the "right" signals. Tempest for Eliza displays pictures on your screen. one for each note in the song. [Note: Markus G. Kuhn's and Ross J. Anderson's paper; "Soft Tempest: Hidden Data Transmission Using Electromagnetic Emanations" was used as a reference when programming Tempest-AM. This paper is a must read before going further testing Tempest-AM. The paper is availabe from http://www.cl.cam.ac.uk/~mgk25/ih98-tempest.pdf I strongly recommend to read the paper thoroughly.] Why this program ? ------------------ You need no additional hardware to understand that it is really possible to observe your computer without physically touching it. (tempest). I wrote this program because it was fun and because it teaches in an amusing way that tempest really exists. i want people to understand that their computers can be observed. And last but not least you can listen to music without a soundcard! More information on Tempest --------------------------- Tempest and electromagnetic radiation is an interesting topic. There aren't very much public literature on this topic. Luckily, there are a few technical papers and web sites on the net that are a must read. Papers to read: o Markus G. Kuhn's and Ross J. Anderson's, "Soft Tempest: Hidden Data Transmission Using Electromagnetic Emanations" http://www.cl.cam.ac.uk/~mgk25/ih98-tempest.pdf o Wim van Eck, "Electromagnetic Radiation from Video Display Units: An Eavesdropping Risk?" http://jya.com/emr.pdf o Christopher Seline, "Eavesdropping On the Electromagnetic Emanations of Digital Equipment: The Laws of Canada, England and the United States" http://www.eff.org/pub/Privacy/Security/tempest_legal.draft Here's a few links to start from: o Ros Anderson's website, is a good starting point and has links to go further. http://www.cl.cam.ac.uk/users/rja14/#Tempest o The Complete, Unofficial TEMPEST Information Page, a great site. A lot of links to other websites and papers. http://www.eskimo.com/~joelm/tempest.html Compiling and runnning ---------------------- you must have libSDL installed. see http://www.devolution.com/~slouken/SDL/ type ./configure make now start X11. make sure that you choose low colordepth this gives much higher speed !!! 8 bpp is optimal. if the cpu runs at 100% the music will slow down, i.e. short tunes will get longer than they usually are. the song will sound bad :) start xvidtune. write down the values of HDisplay VDisplay HTotal Pixel Clock now go and get a short wave AM receiver. (pocket radio, put switch into SW position (if it is named this way;)) dial close to 10 Megahertz now start ./tempest_for_eliza 105000000 1024 768 1400 10000000 songs/forelise pixelclock Hdisplay VDisplay HTotal radio music *1000000 frequency file the program runs in fullscreen. now SLOWLY move a little left and right on your radio to find the 10 Megahertz. You will hear a Song for Eliza from Ludwig van Beethoven the song will be on the radio at multiple frequencies. but the best transmission is at the frequency you gave on the commandline. if your computer makes too much noise on that frequency you could also try some other radio frequencies. it is up to you. now go and try other songs included in the songs/ subdir !! Let's be a spy -------------- Observe your computer from within another room ! take the radio into another room. play with the antenna touch earth connections or other things. just play around. depending on the distance and the quality of your monitor you will hear good voice. i have a TCO'99 monitor and i can still hear GOOD music ! Tempest for MP3 AM --------------- get your favourite mp3 file to the current directory. let's call it 'foobar.mp3'. make sure you have "amp" and "sox" installed. you must use X11 with 8 bits colordepth. use the old -bpp 8 option to your xserver or the new -fbbpp 8 option if you have a newer Xserver. first we need to find out what the correct sampling rate will be. therefore start: ./tempest_for_mp3 115500000 1024 768 1350 810 1500000 0 20 notexist.raw pixel-clock resy vtotal playmode resx htotal radio-frequency amplification filename note that the vtotal parameter is a new one and must be read from the xvidtune screen! also note that the notexist.raw file does not exist. we just want to see the output of the program, play no music yet. it will display: "audio file frequency should be 13519.890261 Hz" now take this value and convert your mp3 like this: ./mksong.sh 13519 foobar.mp3 cool.raw you can now listen to it with this command: ./tempest_for_mp3 115500000 1024 768 1350 810 1500000 0 20 cool.raw notice the low radio frequency of only 1500 KHz. well... i found out that you actually don't need a short wave radio if you put your antenna close enough to your computer screen. lower frequencies also work. and even nowadays most radios can receive AM waves :) so finally you can send to any radio you have. (but no FM, sorry...) the playmode and amplification parameters control the algorithm for playback. you can choose between playmode 0 and playmode 1. playmode 1 produces a correct AM signal. amplification 1 is correct. if you increase amplification the audio signal will be clipped. but since there is so much disturbing noise anyway, this doesn't matter. you can use playmode 0 to further increase output energy. the signal is not very good anymore then :) but it is louder. the problem is i cannot use the time when the electron beam does the blanking and retrace phase. unfortunately there's no way around this, folks. if your song has heavy basses, you shouldn't over-amplify, because you won't hear the melody while the bass is drumming then... Tempest for MP3 FM --------------- The first steps are the same as for Tempest for MP3 (The AM player) get your favourite mp3 file to the current directory. let's call it 'foobar.mp3'. make sure you have "amp" and "sox" installed. you must use X11 with 8 bits colordepth. use the old -bpp 8 option to your xserver or the new -fbbpp 8 option if you have a newer Xserver. You also need to be root because this player uses dga and dga needs root access. run xvidtune and read the parameters from the screen or run xvidtune -show to read the parameters in one line >xvidtune -show "1024x768" 78.80 1024 1040 1136 1312 768 769 772 800 +hsync +vsync name pixel-clock resx htotal resy vtotal We also need to find out what the correct sampling rate will be. therefore start: ./tempest_for_mp3 78800000 1024 768 1312 800 10200000 0 1 notexist.raw pixel-clock resy vtotal playmode resx htotal radio-frequency amplification filename Note that the vtotal parameter is a new one and must be read from the xvidtune screen! Also note that the notexist.raw file does not exist. we just want to see the output of the program, play no music yet. it will display: "audio file frequency should be 60060.975610 Hz" now take this value and convert your mp3 like this: ./mksong.sh 60060 foobar.mp3 cool.raw you can now listen to it with this command: ./tempest_for_mp3_fm 78800000 1024 768 1312 800 10200000 0 1 cool.raw notice the radio frequency of 10200000 Hz (10.2 MHz). This means it will transmit at 10.2 MHz but because the signal is sampled at the pixelclockrate of 78.8 Mhz it will also tranmit a small signal at 78.8 +10.2 MHz and 78.8 -10.2 Mhz. 78.8 +10.2 happens to be 88.0 MHz The lowest frequency your FM radio can receive. The main signal at 10.2 MHz will be the strongest. If you want to receive the original signal you have to change 10.2 to 88.0 MHz This only works well if your pixelclock is more the twice that. This means more then 172.0 MHz. so if your pixelclock is greater then 172.0 MHz radio-frequency=wanted frequency if pixelclock less then 172.0 MHz but higher then 108.0 radio-frequency=pixelclock - wanted-frequency if pixelclock less then 108.0 radio-frequency=wanted-frequency - pixelclock Most videocards can use very high pixelclocks but not all monitors do. Higher pixelclock means higher horizontal and vertical refreshrates. I put two special modeline in my XFree86Config-4 in the monitor section and increased the maximum HorizSync from 86 to 98, just about as much as my monitor can handle. The first special modeline "2048x1280tempest" is a modified version of the output of xvidtune -show I used the largest horizontal resolution my displaycard could handle I increased the pixelclock to 180.0 to get above the 172.0 limit I also made VDisplay VSyncstart VSyncEnd and VTotal as close to eachother as possible as the driver would accept Betweeen VDisplay and VTotal no signal will be sent so the longer this time is the more distortion and noise you get. The same goes for HDisplay HSynStart HSyncEnd and HTotal although this is less critical. Ideally I would want VDisplay=VSyncstart=VSyncEnd=VTotal=1280 but I would have to hack the XFree driver to accept that. Pay attention, your monitor will not like these settings. I even had to switch of my monitor during the (re)start of X otherwise the dcc logic in the driver would recognise that my monitor officially cannot handle these settings. I also added a less stressfull but still optimized modeline "1024x768tempest" The only thing I did here is change the VTotal setting from 800 to 772. This is not as stressfull for the monitor although it is not good for normal use because the top lines of you screen will be all over the screen because they are displayed during the vertical retrace. In this mode the distortion and noise is also low but I can't use direct frequencies in the FM band and must use the setfrequency=wantedfrequency-pixelclock trick Section "Monitor" Identifier "Generic Monitor" #original for my monitor: HorizSync 30-86 HorizSync 30-98 VertRefresh 50-150 ModeLine "2048x1280tempest" 180.0 2048 2056 2084 2092 1280 1281 1282 1283 -hsync +vsync #default modeline for 1024x768: ModeLine "1024x768" 78.80 1024 1040 1136 1312 768 769 772 800 +hsync +vsync ModeLine "1024x768tempest" 78.80 1024 1040 1136 1312 768 769 772 773 +hsync +vsync EndSection Section "Screen" Identifier "Default Screen" Device "Generic Video Card" Monitor "Generic Monitor" DefaultDepth 8 SubSection "Display" Depth 8 Modes "1024x768tempest" "2048x1280tempest" "800x600" "640x480" EndSubSection SubSection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" EndSubSection EndSection If you want to use high pixelclocks but your monitor can't take it you can also play with your monitor off. I could only receive this way if I held the antenna of my FM radio right to the connector of my displaycard. I could make the signal much much much stronger when I connected a loose vga cable to my displaycard and connected a loose end of electrical wire of approximate 75 centimeters to pin 1 (see http://www.bbdsoft.com/video.html for vga connector pinout) This loose peace of wire acts as an antenna. In this mode I could still receive the signal a block away from my home. This however defeates the original goal of the project. NO HARDWARE MODIFICATIONS, proof your monitor is your transmitter. Playmode: playmode =0 is the normal setting if playmode >0 then a testtone of requested frequency will be played in stead of the songs ./tempest_for_mp3_fm 78800000 1024 768 1312 800 9700000 1000 1 nonexist.raw will play a 1000 Hz tone at 78.8+9.7=87.5Mhz The playmode means something completely differen here then in the tempest for MP3 AM player Future plans for tempest for mp3 FM. I modified this project because I needed a FM testsignal generator with a wide frequency range. I can use this to test the software defined radios I am building with gnuradio. Well, it is not a perfect testsignal generator but usable and cheaper as building/buying one. I am planning to try to hack the xfree driver for my card to try to trick the hardware in not leaving any gaps in the signal during horizontal or vertical retrace. Maybe I also build a stereo version of the transmitter. This only needs to be a converter which generates a fmstereo encoded raw file from the mp3 or wav file. I also have not yet incorperated the 75usec preemphasis which is required of a correctly encoded broadcast FM signal (This is just a high pass filter) I am also planning to build a gnuradio module build on this code as a general high speed DAC (general output sink) and as a special FM and/or AM output sink. Related projects: gnuradio related projects from Martin Dvh: gnuradio high-speed input DAC module using a bt878 capture card video input gnuradio project to make the tuner of a bt8x8 card usable as generic broadband tuner. (This project is not finished and needs (hopefully small) hardware modifications ) modified bttv driver to capture in raw mode with less gaps in vertical sync modified btaudio driver to use higher sample frequency and 6dB higher input sensitivity bttv settings app/lib to set testmode (no sync) and pll frequency High ,settable and stable gain setting for bt8x8 ADC (This needs settable external ADC reference voltage for bt8x8 (No AGC, use exact stable setting). This is a hardware and software modification. Credits ------- The original idea is from Pekka Riikonen. (see file AUTHORS) he wrote the program tempest-AM-0.9. Erik Thiele used a simplification of his routines to create the AM signal. MDVH (Martin Dvh) wrote tempest for mp3 FM, based on the original idea but used a different approach.