|
|
Dave W.
Info Junkie
USA
26022 Posts |
Posted - 06/03/2005 : 22:16:01 [Permalink]
|
quote: Originally posted by Ricky
But the one thing I can't figure out, Dave, is how you would code for that Baudot code. Did you just do one long switch statement? Or was it all done by hand?
Ask, and ye shall receive:
char Codes[2][32] = {
{'b','T','n','O',' ','H','N','M',
'r','L','R','G','I','P','C','V',
'E','Z','D','B','S','Y','F','X',
'A','W','J', 1,'U','Q','K', 0},
{'b','5','n','9',' ','u',',','.',
'r',')','4','&','8','0',':',';',
'3','"','$','?','b','6','!','/',
'-','2','\'', 1,'7','1','(', 0}
};
int cset = 0;
int cout = 0;
void rout(DWORD ch)
{
printf("%02lX",ch);
cout++;
if (cout>=4)
{
printf(" ");
cout = 0;
}
}
void outp(char ch, int lv)
{
if (lv>=3)
{
printf("Cannot encode '%c'\n",ch);
return;
}
if ((ch>='a') && (ch<='z'))
ch = ch - ('a'-'A');
for (int i=0;i<32;i++)
{
if (Codes[cset][i]==ch)
{
rout((DWORD)i);
return;
}
}
if (cset==0)
{
cset = 1;
rout(27);
outp(ch,lv+1);
return;
}
cset = 0;
rout(31);
outp(ch,lv+1);
}
void main(void)
{
char outt[] = "This is a test.";
for (int i=0;i<strlen(outt);i++)
outp(outt[i],0);
} And that's all there is to it. Sure, it could be a little more robust, a little more efficient, and a little easier to read, but gimme a break, it took ten minutes to write and another five to debug. |
- Dave W. (Private Msg, EMail) Evidently, I rock! Why not question something for a change? Visit Dave's Psoriasis Info, too. |
|
|
Dave W.
Info Junkie
USA
26022 Posts |
Posted - 06/03/2005 : 22:25:12 [Permalink]
|
quote: Originally posted by Ricky
Well shit Dave, an OR bitshift? Come on, how the hell am I supposed to see that? Alright, I probably should have at least thought along those lines, which I didn't, but still...
Well, I was hoping you'd look at the 3-bit fields and wonder why the hell there were so many numbers which broke down into one 110 and seven 000 fields. Six? What's a six? Well, a space character has the sixth bit set...
Especially after I gave you a wrong code which was full of fives. The error I made there was in numbering the bits 0 through 6, instead of 1 through 7. An ON bit-0 was indistinguishable from the ignore 000. So instead of an 'A', you would have decoded an '@' and other confusing crap.
That error, though, was a huge hint, had you gone back and looked at those numbers as 8, 3-bit fields.quote: I'm just glad I gave up when I did, I could have spent years on that and never figured it out. Very well done.
Sorry, I though I was offering up a softball. Wait 'til the next one... Hehehehehehe...quote: I'll code up an algorithm to decode it and then make my final code (at least for the time being) in the morning.
Take your time. |
- Dave W. (Private Msg, EMail) Evidently, I rock! Why not question something for a change? Visit Dave's Psoriasis Info, too. |
|
|
Ricky
SFN Die Hard
USA
4907 Posts |
|
Dave W.
Info Junkie
USA
26022 Posts |
Posted - 06/05/2005 : 20:19:42 [Permalink]
|
Hmmm... The 5th bit (from the left) of every octet is always 0. And the 6th bit is only 1 if and only if the whole octet is 01110100 (which happens only 12 times in 293 octets. Veeeeeery interesting...
I'm just thinking out loud, Ricky, not fishing for clues. I just don't have much time tonight, and want to be sure I don't forget these "notes." |
- Dave W. (Private Msg, EMail) Evidently, I rock! Why not question something for a change? Visit Dave's Psoriasis Info, too. |
|
|
Dave W.
Info Junkie
USA
26022 Posts |
|
Ricky
SFN Die Hard
USA
4907 Posts |
|
Dave W.
Info Junkie
USA
26022 Posts |
Posted - 06/06/2005 : 20:23:43 [Permalink]
|
Hell, Ricky, I said I wanted a hint, not for you to give away the answer. Here:50 4B 03 04 14 00 00 00 08 00 A6 B9 C6 32 3C 1D 9A D1 71 02 00 00 4E 04 00 00
0C 00 00 00 74 6F 5F 72 69 63 6B 79 2E 74 78 74 4D 54 CD 4E DC 40 0C BE 23 F1
0E 66 2F 7B 09 B4 EA 0B 20 2A 10 5A A9 2D 07 A0 3D 7B 13 27 33 DD C9 4C 3A 9E
90 E6 ED FB 79 B2 A0 DE 36 89 FD FD D9 DE DD D3 EB CB FD DD CB C3 3D FD 3A BC
7C 3B FC 78 7C BC BD BA BD DA 11 1D F6 23 C5 54 48 DE 24 92 CE 59 C8 F7 54 1C
97 BD 12 53 16 0E E4 A3 CE A1 50 CA 56 D8 90 26 34 85 40 AC 3A 8F 28 AF 95 6D
99 39 84 15 2D 6D 1A A7 E0 47 89 28 E5 D8 91 F2 4A 7B 00 C6 13 AD 69 DE 03 0D
A8 3A A5 A8 72 43 74 D7 17 C9 84 D6 86 0E C4 55 8A F3 71 30 11 A6 6A C8 DC FA
34 6B 83 A7 DB CB 8B CB 8B BB B8 2E BC 36 54 01 95 7A 88 9A 7C 7B B2 16 A3 EE
84 16 5F 1C AA A9 E3 31 D2 34 47 53 56 7C 8A 46 EC 0B 71 D9 D8 CC 62 B5 07 D1
FD B5 F5 8F A2 2A DD D6 3F 9A B6 03 4D 39 1D F9 88 8A 36 CD A1 23 C7 6F 42 91
7D 40 19 A0 7E CF 5A A8 CF 69 A4 20 05 36 AE FB 2C 7F 66 89 2D 62 88 1C 56 F5
D0 ED B8 03 90 79 39 0A 12 96 BF 93 B4 C5 E8 74 E2 56 94 4A C2 87 77 21 CE 0F
8E 20 B5 8A 0B 5E 0B 54 3C 3B 11 75 37 66 FE C9 21 D2 DA 82 24 33 06 E2 07 0F
22 02 A9 9A C5 66 7B DF FB 0C 61 16 46 57 4D F1 00 9E 91 3B 9B 15 3D 3F 3C 7C
07 F4 49 AC B6 AA 33 52 CC 60 53 56 A3 D2 1A EF E6 CF A5 C9 D4 56 45 3B 53 25
8C B7 29 0A 4D 92 35 C5 1D 2D 35 1B 98 40 52 62 E2 B0 01 42 F3 B4 25 A9 F6 A0
29 A3 A7 37 9B 68 A9 75 1C 75 01 AB 0D 10 42 E0 F3 A9 B7 94 B3 4A 43 3F E1 E9
23 FA AA 22 A4 74 82 1B 80 3B AF F8 E6 D1 A6 A8 6E A5 2E D9 27 3C 3E A6 34 D8
60 40 5C 9C 00 2B 67 F8 39 F3 34 67 98 77 DF FF CD B3 83 97 F3 A6 4E 9C 0D 40
6D 43 B6 C1 16 A3 C3 44 53 87 10 AE 6D B5 A5 F8 BA 4D C5 C1 4C B7 8D 25 56 46
6C 2E 0C 21 B8 AE A1 8F A0 8C 0C BF 72 04 B0 4B 8B 39 A8 70 42 5F 79 EE EC EE
58 7D 58 6D DB F6 F5 56 1A A4 AC B6 FE 76 2C 90 81 BB CC 9B 50 86 32 A9 81 D9
30 9A 1D 1D E7 F3 0E 7E F9 4C 2B 38 A0 7B 48 76 47 0B 10 96 94 EB 55 40 2A 93
AE 5A 64 A4 C5 F9 D6 D1 EB 33 FE 05 CE EC A6 A4 2E 54 C9 08 6A C4 7E BC 2F 8C
DD 66 AC 6B 0E B4 B8 C7 F8 02 7C 89 37 93 37 FF 00 50 4B 01 02 14 00 14 00 00
00 08 00 A6 B9 C6 32 3C 1D 9A D1 71 02 00 00 4E 04 00 00 0C 00 00 00 00 00 00
00 01 00 20 00 B6 81 00 00 00 00 74 6F 5F 72 69 63 6B 79 2E 74 78 74 50 4B 05
06 00 00 00 00 01 00 01 00 3A 00 00 00 9B 02 00 00 00 00 |
- Dave W. (Private Msg, EMail) Evidently, I rock! Why not question something for a change? Visit Dave's Psoriasis Info, too. |
|
|
Boron10
Religion Moderator
USA
1266 Posts |
Posted - 06/06/2005 : 21:16:06 [Permalink]
|
...And this is why I wanted to go into Navy Cryptography. But, no, I had to listen to my stinking recruiter who dangled the enlistment bonus (that I never got), faster advancement (that I never needed), and more opportunities for college (which I took advantage of) in front of me and told me I'd get them all if I went Submarines. Now, I don't even have the time to play with these cyphers.
Anyway, even if I had gone crypto it wouldn't have been as cool as I had idealized it.... |
|
|
Dude
SFN Die Hard
USA
6891 Posts |
Posted - 06/06/2005 : 23:38:22 [Permalink]
|
quote: Anyway, even if I had gone crypto it wouldn't have been as cool as I had idealized it....
crypto.... isn;t that Superman's dog?
|
Ignorance is preferable to error; and he is less remote from the truth who believes nothing, than he who believes what is wrong. -- Thomas Jefferson
"god :: the last refuge of a man with no answers and no argument." - G. Carlin
Hope, n. The handmaiden of desperation; the opiate of despair; the illegible signpost on the road to perdition. ~~ da filth |
|
|
|
Ricky
SFN Die Hard
USA
4907 Posts |
|
Cuneiformist
The Imperfectionist
USA
4955 Posts |
Posted - 06/07/2005 : 10:30:39 [Permalink]
|
Jesus Christ-- I've been wondering what it is that keeps this topic among the "Newest Posts" and here I find that it's still this crypto-code stuff. If I had any skill with numbers and computer coding and binary whatever, I'd toss a code or two in. But I don't, so I'll just keep marvelling that this thread has passed 70 posts! |
|
|
Dave W.
Info Junkie
USA
26022 Posts |
|
NubiWan
Skeptic Friend
USA
424 Posts |
Posted - 06/09/2005 : 10:35:42 [Permalink]
|
* * Jighjacked Dhread Ulert!!! * * |
|
|
|
H. Humbert
SFN Die Hard
USA
4574 Posts |
Posted - 06/09/2005 : 13:40:43 [Permalink]
|
quote: LONDON - Is Coldplay trying to tell us something with that multicolored symbol on the cover of their new album? Cubelike images adorn the packaging, both on the cover and the liner notes, of "X&Y," the British band's much-anticipated third album that was released Tuesday. New Music Express asked a number of top art experts to figure out what the geometric figure on the cover means. They've concluded that it's a 19th-century telegraphic code known as the Baudot Code, or The International Telegraph Code Number One. It was used in teletype machines in the late 1800s.
|
"A man is his own easiest dupe, for what he wishes to be true he generally believes to be true." --Demosthenes
"The first principle is that you must not fool yourself - and you are the easiest person to fool." --Richard P. Feynman
"Face facts with dignity." --found inside a fortune cookie |
|
|
Dave W.
Info Junkie
USA
26022 Posts |
Posted - 06/09/2005 : 16:15:16 [Permalink]
|
Here is the Coldplay cover. To be Baudot, one must read each five-bit symbol vertically (horizontally, there would only be four bits). Going from top to bottom, left to right, we get 10111, 11011, 00011, and 10101. This would be X, figure-shift, 9, and 6. Obviously, they screwed up, as the 3rd symbol should have been 01011 for the ampersand, the 4th symbol should have been letter-shift, and then the fifth symbol should have been 10101 for Y. Whoever designed the album cover obviously didn't realize that the figure-shift "sticks" until a letter-shift comes along (making transmission of streams of decimal digits faster), and he/she/they were off by a bit for the ampersand symbol, anyway. Or, maybe they were using some other version of Baudot's code.
From now on, as an inside joke, I will have to call this Coldplay's X96 album. |
- Dave W. (Private Msg, EMail) Evidently, I rock! Why not question something for a change? Visit Dave's Psoriasis Info, too. |
|
|
|
|
|
|