Wiggles, part 32


Just a little ongoing story to give you something to play with until the next blog post.

YQ ZWMHSBC’Q AX QMM ZHIJIYZYCR QM SXOIC QWOQ NOJOC WOZ O SMQ MV XOIQWUHOLXZ, OCB QWOQ ZMPX MV QWXP TOC AX EXID BXEOZQOQYCR. DMH POD XEXC WOEX WXOIB OAMHQ QWX QZHCOPYZ – QWX AYR QYBOS KOEXZ QWOQ MTXOC-TXCQXIXB XOIQWUHOLXZ TOC TOHZX. QWX QZHCOPY TIXOQXB AD QWX RIXOQ CMIQWXOZQ XOIQWUHOLX MV 2011 CXOISD KYJXB MHQ PYDOLM TYQD, KYQW QWX KOEXZ IXOTWYCR O WXYRWQ MV OSPMZQ 38 PXQXIZ (124 VXXQ) OAMEX ZXO SXEXS. VMI PX, YQ’Z CMIPOS QM ZXX ZYRCZ XEXIDKWXIX VMI XOIQWUHOLX ZWXSQXI OIXOZ, RXCXIOSSD JOILZ OCB MJXC VYXSBZ, KYQW WXYRWQ POILXIZ YCBYTOQYCR WMK VOI OAMEX ZXO SXEXS QWOQ OIXO YZ. MV OSS QWX ZYRCZ Y IXPXPAXIXB CMQYTYCR YC QWYZ TYQD, QWX VOIQWXZQ HJ QWX SOCB YZ KOZ PODAX 6 QM 8 PXQXIZ. Y TMHSBC’Q AX ZHIX, AHQ Y WOB QWX VXXSYCR QWOQ Y KOZ OQ PODAX QWX 1-2 PXQXI JMYCQ. OCB Y WOB CM YBXO WMK QWYZ KMHSB IXSOQX QM PD VYCBYCR O ZXKXI SYCX, WMK AYR YQ KMHSB AX, MI WMK QWXD KMHSB WOCBSX RXQQYCR IOYCKOQXI IHCMVV VIMP QWX TXCQXI MV QWX TYQD QM QWX MTXOC O VXK LYSMPXQXIZ QM QWX XOZQ.

Advertisements

ROKR Airship


I actually ended up getting 3 wooden build-it kits by the Chinese company, ROKR. The first one was the Treasure Box, and this one is the Airship. It’s advertised as being 300 mm x 215 mm x 250 mm (approx. 11.75″ x 8.5″ x 9.5″), so it’s fairly large for what you get. ROKR makes a big deal about the kit containing 7 sheets of pre-cut plywood, but the seventh sheet is pretty small and almost shouldn’t be considered part of the count. There’s also a small collection of steel pins, plastic caps and spacers, a wind-up spring and spring key. I’d guess that the package started out weighing at least 2 pounds (Amazon shows the shipping weight at 2.9 pounds, so I’m not too far off).

I got about 10 minutes in on the dirigible assembly before I remembered to take a process photo. See that stack of disks and pieces to the left, above? That’s all scrap.

Notice the ruler at the top, and the weird stand thing to the left. This kit has a LOT of support tools used in the building of this thing, that aren’t part of the finished airship. The ruler lets you check the lengths of the steel pins and push pieces together, and the stand is used for placing the spacers at the correct distances from the ends of the pins. There are 5 stands of varying height, plus one simple flat disk, for space placement. There’s also a 2-layer plate assembly used at the end for supporting the paddlewheel centers when mounting them on the axels. Pictured above are the parts used for making the dirigible nose propeller.

Finished propeller, plus airframe skeleton disk parts.

Finished prop gear subassembly.

Airframe drive gear parts.

Finished drive gear subassembly.

Nose subassembly, with propeller and airframe supports and drive gear.

Dirigible assembly, with nose subassembly and drive gear fixed in place.

Dirigible with the top, bottom, left and right outer skeleton frames in place, along with the tail ladder. The strips will be inserted through slots in the ribs to make the assembly look more like a balloon.

Finished airballoon assembly. The instructions state that it’s ok to use wood glue to fasten down loose parts. And, one of the strips kept pulling out of its notch in the nose rib. Otherwise, all the strips and other pieces forcefit into place just fine. It took me 3 hours to get this far, largely because I was making beginner-level mistakes and having to disassemble part of my work and reassemble it to fix my errors. I’d started at 10 PM, and decided to quit for the night at 1 AM. (That, and I wanted to go to the store to get some wood glue.)

Starting back up the next day. A lot of these pieces require significant force to slide the tabs into the notches. That, and serious patience (especially those long, thin strips for the dirigible body). I did manage to crack one of the tail fins on the dirigible, but I was lucky in that the crack isn’t noticible unless you know where to look. Otherwise, I’m extremely surprised that I didn’t snap stuff in two with all the pushing I was doing. My fingers still hurt two days later.

Shown above, the ship front left body plate, front wheel assembly, and part of the upper deck.

There are literally a boat-load of gears for this thing, and most of them have to be assembled before doing anything further on the boat body. Above, gear assembly 1. Note that the two smaller gear pieces are not mirror-reverse images of each other. It is possible to put them on the gear shaft wrong so that the teeth are not direct aligned with each other. If this happens, flip one of the gears over and try again.

Parts for gear assembly 2.

Finished gear. This one connects to the two big paddlewheels, later.

This is my favorite part – the ratchet box assembly. Unfortunately, when the cover plate is snapped in place on the box, the ratchet (the 4-armed thing in the lower right corner) gets hidden.

Finished ratchet box, with spring pin.

Parts for gear assembly 3.

Finished gear. Notice the positioning of the spacers. This is what all those little adjustment stands are for.

Parts for the main spoke gear. This is the biggie that drives a lot of the other gears.

Finished main spoke gear, plus spacer spacing stand 4.

Parts of the rear wheel and rudder subassembly.

Finished tail.

Tail drive gear assembly parts. Note that the half-gear disks are strictly ornamental, and don’t actually turn or anything.

Finished tail drive gear subassembly.

Parts for the tail propeller.

Finished tail propellor, plus the tail drive gear and tail wheel subassemblies.

All three pieces set together in position.

Taking the above body plate, mounting the tail assembly, paddlewheel gear, and spring in place.

Now, with the ratchet box on top of the spring. This was kind of tricky, in that the notch in the end of the spring pin needed to hook into place on the spring as the box was set in place.

All of the other gear assemblies are now in place. One of the things I was surprised by for this kit is that while it includes a small tin of wax, there are no indications anywhere in the manual that any of the moving parts need to be waxed at all. I did use candle wax on the paddlewheel gear plate and the matching hole in the body plate, above, but otherwise the kit didn’t seem to need waxing, and I didn’t bother doing it to any of the other gears or surfaces.

Ship body, with the upper front and back deck subassemblies in place (see below for placement).

The ship main body, with the right body side plate snapped in place. This step took some time, because the pins and tabs of the gears and decks didn’t want to align with the side plate notches.

Other side of the current subassembly process.

Parts for the air duct thingie that ships have. Again, the half-gear piece is only for decoration.

Finished thingie subassembly.

Finished paddlewheels, and mounting support plate. I didn’t bother taking process photos for this step, because I figured I already had too many photos by now. The mounting support plate is set under the center of the paddlewheel first, then the ship is set above the wheel so that the wheel axel tabs can be put into place in the wheel. Otherwise, pushing down on the axel would damage the center of the wheel spoke piece.

Putting the dirigible on the ship main body. Note that there are only two sticks supporting the dirigible on the ship decks. This means you have to be careful while handling the airship to prevent snapping those sticks in half. Note also the white plastic ribbon. I’d glued the loose end of the one strip into its notch in the nose of the dirigible, but it was just taking too long for the glue to dry and I was bored with having to sit there holding the strip in place for an hour. So, I took the ribbon (which is used as string in Japan) and tied the strip down against the nose this way. I also took the opportunity to apply glue to all the other strip ends as well, just to make them less likely to pull free later on.

The tail wings. The two little disk pins on each wing are notched off-center, so the wing pieces look like they’re slightly downwardly curved. I think this is a nice touch.

And, we’re done. One thing I’m not as happy with regarding the instructions is that there’s nothing showing how to wind up the spring, how to hold the wheels to keep them from moving as you turn the key, or how many turns to make without damaging the spring. All the parts move freely, so that’s good. I’ve been able to turn the key 5 full rotations, and that gives me a running time of about 5 seconds, with a full distance of over 10 feet (I can’t be precise here, because my apartment is small, and the airship runs into the wall before the spring fully unwinds. I’m thinking that it might be able to cover 20 feet before stopping.) There’s a little wooden lever at the left of the back deck, but I’m not sure what it’s for. It seems to engage and disengage one of the gears, but I’ve tried sliding it back and forth while letting the airship run and I haven’t noticed it having any kind of effect on anything.

The ship took another four hours to build, so all-total I’d say this was a 7-8 hour project. If I tried it again, I might be able to bring that down to 6 hours. As I say, there wasn’t any need for the tin of wax, or the little scrap of sandpaper. There were a lot of extra parts in case something broke or got lost along the way, but I didn’t need any of them. There was also a HUGE amount of scrap wood left over – maybe 1 pound worth. But, it was fun to build, and I’m waiting for my English classes to start up so I can show it off to a few of my students.

This airship is a novelty item, and doesn’t have a lot of replay value. Just put it on a shelf and show it off to your friends at parties. Although, you can run some LEDs through the dirigible, if that’s something that appeals to you, and use it as a Christmas decoration for next year.

“Look! On the ground! It’s a dog! It’s a shoe! No, it’s super shoedog!”

Thinking About Encryption, Part 35


For some reason, I’d been hesitating on tackling Morbit because I’d somehow thought that it was going to be too difficult for me right now. But, the Nov.-Dec. 2018 ACA Cm newsletter just arrived in the mail (I’m typing this up on Oct. 31st), and it contained an incredibly useful article on how to attack a Morbit CON without a crib. After reading that article, I decided to look at this cipher type a little closer. I’m not finding much on Morbit in a yahoo search, other than a handleful of solvers, and the descriptions from the ACA pages. I’m thinking that this may be an algorithm original to the ACA.

The name can be thought of as “MORse BIT.” It’s based on Morse code, and is actually a simplified version of Fractionated Morse. There are three places where Morbit differs from FM.

1) Fractionated Morse uses a 3-digit trinary system:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
. . . . . . . . . - - - - - - - - - X X X X X X X X
. . . - - - X X X . . . - - - X X X . . . - - - X X
. - X . - X . - X . - X . - X . - X . - X . - X . -

Morbit uses a 2-digit trinary system:

1 2 3 4 5 6 7 8 9
. . . - - - X X X
. - X . - X . - X

2) As illustrated above, FM uses the letters “A-Z” to represent each triplet within the ciphertext. The Morse code for “COME QUICKLY WATSON”, is:

"-.-.X---X--X.X--.-XX..-X..X-.-.X-.-X.-..X-.--XX.--X.-X-X...X---X-."

And in FM, that becomes (no keyword):

KHOOI MPFXK HFDHE YOFPC NV

With Morbit, we have:

4 4 8 5 8 6 3 5 2 9 1 6 1 8 2 3 4 6 2 1 8 2 6 7 5 7 6 6 1 3 5 6 4
- - X - X - . - . X . - . X . . - - . . X . - X - X - - . . - - -
. . - - - X X - - X . X . - - X . X - . - - X . - . X X . X - X .

Or, (no key): 44858 63529 16182 34621 82675 76613 564

3) The keyword in FM can be relatively short, maybe 4-7 letters long (no duplicates), and then the rest of the alphabet is just added to give 26 letters for the triplet assignments. Ex (Key = graham):

X Y Z G R A H M B C D E F I J K L N O P Q S T U V W
. . . . . . . . . - - - - - - - - - X X X X X X X X
. . . - - - X X X . . . - - - X X X . . . - - - X X
. - X . - X . - X . - X . - X . - X . - X . - X . -

But with Morbit, we only have two trinary digits per column, and 9 columns. The general rules say that you’re supposed to pick a 9-letter key and number that in alphabetical order (don’t bother worrying about duplicated letters):

A L P H A B E T S
1 6 7 5 2 3 4 9 8
. . . - - - X X X
. - X . - X . - X

I’m not seeing a lot of reason for picking a keyword first, because there’s no way to recover the keyword once you’ve solved the CON. It’d be just as easy to pick a random sequence for the digits 1-9 directly, and then use that.

[Edit: Having just finished writing a solver for the Myszkowski transposition cipher, I ended up having to write a word search program that finds words with repeating letters, and in a specific letter sequence. If I find the numeric key for Morbit, I can use the Myszkowski word finder to print out potential original Morbit keywords.]

Anyway, with this new key, the ciphertext becomes:

5 5 9 2 9 3 7 2 6 8 1 3 1 9 6 7 5 3 6 1 9 6 3 4 2 4 3 3 1 7 2 3 5
- - X - X - . - . X . - . X . . - - . . X . - X - X - - . . - - -
. . - - - X X - - X . X . - - X . X - . - - X . - . X X . X - X .

Or, 55929 37268 13196 75361 96342 43317 235

On the other hand, I could also add “X” padding at the front and end of the plaintext Morse code to get:

"X-.-.X---X--X.X--.-XX..-X..X-.-.X-.-X.-..X-.--XX.--X.-X-X...X---X-.X"

And that would completely change the ciphertext output (the recipient would need to know about the padding if it’s optional).

In all other respects, Morbit and Fractionated Morse are identical. This means that the deciphering, and solving steps are the same.

But, because Morbit uses a 9-digit key instead of a 26-character alphabet, it is MUCH, MUCH more prone to falling under a pure brute force attack. Yes, if you have a crib, you can try placing it in the cipher text as you would with FM. However, I repurposed my FM solver to handle Morbit with very little effort (that took about 1 hour, including testing and debug), and was able to solve 3 separate Morbit CONs in under 15 minutes each (my solver found the solutions to 2 of the CONs in less than 5 minutes each) through brute force. I did use the cribs to test the output results and only print those strings that contained the correct crib text, but that’s not that big a time saver.

The reason is that a brute force approach usually generates illegal strings. These strings either have 3 or more X’s in a row, or produce sequences of dots and dashes that don’t exist in the Morse code table. I just fail the loop if I encounter an illegal condition, and increment the key to the next value. Only a fraction of the key permutations produce legal, although unreadable, text out, and of that text, I can scan for real English words for use in a more precise crib string. That is, even if I don’t have a crib, I can just run the solver and print out all legal strings. If one of those strings includes something like “always”, then I’ll stop the solver, specify “always” for my crib and restart it. If I chose correctly, then the solver will output only one string, which will be the actual solution for that CON. And the solution will come out in no more than 5 minutes, usually.

Summary:
1) Morbit is a simpler form of Fractionated Morse.
2) It uses 2-digit trinary codes, where FM uses 3-digit trinary.
3) Morbit also uses a straight-forward 9-digit key (no repeating digits).
4) All of the rules for placing a crib in FM also work for Morbit.
5) Morbit’s key search space is so small (9!), it can be solved through brute force on the key in 15 minutes.
6) By itself, Morbit isn’t very secure, but it can be hardened by adding a transposition (Redefence, or Sequence Transposition) step.

Wiggles, part 31


Just a little ongoing story to give you something to play with until the next blog post.

OYTYM RD UYZH BT WF EBMZKHZD WF RDGYMZD, UWDJ WF NERVE YKH TKHJJL DUYGG YMZ FYK YNYL FKWU JEH UYRM FWBK. JEH GYKAHDJ WMH RD EWMDEB, EWUH WF JWQLW, WDYQY YMZ QLWJW. XBJ, BMGHDD LWB’KH DWUH ZRDJYMVH RMGYMZ FKWU JEH VWYDJ GRMH, UWDJ WF JEH VRJRHD WM EWMDEB YKH AWRMA JW XH TKHJJL VGWDH JW DHY GHIHG. HIHM DW, JWQLW EYD DWUH IHKL ZHHT DBXNYL GRMHD. JERD UYQHD JERMAD RMJHKHDJRMA ZBKRMA JEH XRAAHK JLTEWWMD RM JEH DBUUHK, NEHM HIHKLJERMA AHJD FGWWZHZ. JEH JWQLW VRJL AWIHKMUHMJ TBJ RM Y ARAYMJRV VRDJHKM, JEH UHJKWTWGRJYM YKHY WBJHK BMZHKAKWBMZ ZRDVEYKAH VEYMMHG, NERVE EYD TBUTD JEYJ VYM UWIH 200 JWMD WF NYJHK THK DHVWMZ (JEYJ’D YXWBJ JEH IWGBUH WF Y 25-UHJHK DNRUURMA TWWG). MWJ HIHKL VRJL WK JWNM RM OYTYM EYD JEYJ UBVE UWMHL, WK JEYJ UBVE MHHZ FWK Y XHGWN-AKWBMZ RMFKYDJKBVJBKH. JEH JWNM R NYD RM NYD OBDJ XRA HMWBAE JW OBDJRFL EYIRMA 3 DJWTD WM JEH UYRM JKYRM GRMH, YMZ MW DBXNYL DLDJHU. XBJ, R’Z MHIHK KHYGGL DJWTTHZ JW JERMQ YXWBJ NEYJ’D KHYDWMYXGH FWK Y DHNHK DLDJHU RM Y DUYGGRDE VRJL YJ DHY GHIHG.

ROKR Treasure Box


I received two wooden build-it kits for Christmas this year. While they’re generally referred to as puzzle kits, only the Treasure Box is a true puzzle – everything else are just build-its. Anyway, first up is the Treasure Box, by the Chinese company ROKR. (On the cover, the packaging calls it “Treature Box”, so that’s a warning as to what the English instructions inside are going to be like. But, to be honest, the instructions weren’t that bad, and the illustrations were mostly good enough to work from.) The kit is heavy, at about a pound or so, most of the weight being from the 5 sheets of high-grade 1/8″ plywood. There are 3 large sheets, and 2 half-sized sheets. There’s also a good selection of back-up pieces for anything small enough, or brittle enough, to break as you’re handling them. I didn’t realize that initially… The kit also comes with a small tin of wax, a way-too tiny piece of sandpaper, and a little bag of wooden sticks that you have to cut up for use as pins and axels.

Having read the Amazon reviews of similar kits, I knew that waxing the moving parts was critical, so I bought a box of regular candles and a cloth rag from the 100 yen shop (the Japanese version of the Dollar Store) before getting started. The first assembly is a little rotating disk tool that is supposed to be used for calculating the P-code for use in setting the combination lock. However, the manual has the full table of codes at the back, so the disk tool isn’t really necessary. It is important to note, though, that due to the way the lock is constructed, there are certain codes that don’t work. There’s a separate table at the front of the manual listing the 3-digit P-codes to not use.

Pictured above, the combination lock disk holder, pin and top lid latch subassemblies.

Assembled disk holder and top lid latch, on the box base plate. Note the little circular notch at the left of the lid latch. The kit comes with a rubber band that’s used for making the lock work. That band fits into that circular notch to pull the latch back to let the lid open up, when the correct combination has been entered.

Base assembly, with the beginnings of the front plate subassembly. The notched circle on the back side of the front plate is just there to rotate when you enter the combination for appearances. It’s not actually part of the lock itself.

Assembled lock. I really wish I’d taken a photo of the three disks before putting this part together. The disks each have a curved notch at the rim that the lid latch arm fits into when the correct combination is entered. The combination itself is set by putting little wooden pegs into slots set around the center of the disks. The lock mechanism is the standard rotating type – turning the knob makes disk 3 rotate. The peg on that disk will engage with disk 2, and continuing to rotate disk 3 will eventually cause disk 2 to engage the peg of disk 1. Turn all three disks together until the notch for disk 1 is under the latch arm. Rotating disk 3 fully the other direction engages disk 2 from the other side of the peg. Keep turning until the disk 2 notch is under the latch arm. Then turn disk 3 back the first direction until its notch is under the latch arm, and the rubber band attached to the lid and the latch arm will pull the latch into the 3 aligned notches, allowing the latch fingers to disengage from the lid, and the lid can then be opened.

The rubber band is the semi-milky white thing at the right side of the top of the lock assembly.

The front of the main box, with the combination dial. The pieces are all precision cut, and force fit together snuggly enough that you don’t need glue or nails. I made so many mistakes in putting the rubber band on the latch arm (not putting it over both latch fingers, not guiding it through the above circular notches) that in removing the faceplate and putting it back on that the snug fit was being lost.

The box has three separate mechanisms. First is the combination lock. Second is an iris door on the top of the box lid. And third is a little elevator mechanism that is used to lift whatever (tiny) treasure you put inside the elevator compartment. Pictured here is part of the elevator outer frame, and twist knobs for raising and lowering the compartment.

The outer frame and knob face are assembled to the right. We have the 2 keys for the left and right knobs, plus the assembled elevator compartment to the left.

The compartment is in place within the outer frame, in the raised position. There are two small grill doors that automatically open and close as the keys are turned. The left door is in place, and the right door and axel pin are to the right of the photos. As mentioned above, you’re supposed to wax all the moving parts so that they work against each other with less friction or binding. I decided to err on the side of caution, and I applied wax twice to all of the wheel faces, and rubbed them down with the cloth rag until the wax was slick and glossy. Most of the gear teeth were too small and close together for that, though, so I just rubbed on wax flakes, and meshed the gears together enough to get the wax to stick inside the gear teeth long enough to affix the gears in place in their assembles. After that, I worked the moving assemblies back and forth until they stopped binding against each other. Note that one of the gears for raising the compartment snapped on me as I was trying to remove it from the key axel. It was enough to take out one tooth of the gear, but not enough to affect the operation of the gears themselves. At this point, I hadn’t figured out that I had a spare for that piece, so I just left it as-is. If I had known, I might not have done anything differently, because I’d have needed to completely shatter the bad piece to get it off the axel to replace it. No harm, no foul.

The finished elevator compartment subassembly, plus the two keys. It’s a pretty neat little design, and the gears in the center of the front plate intermesh so that turning just one key will cause the top doors to open up and the elevator compartment to rise smoothly. But, using both keys together looks more cool.

The elevator subassembly has been put into place on the base plate along with the combination lock assembly. The back faceplate subassembly is to the left of the photo, waiting to be placed on the base. I really like the way the cuts have been made to allow the plywood to be curved into shape without breaking or requiring excessive molding.

The finished main box assembly, back side. The two fingers at the top front of the photo are the hinges for the lid.

And the front side.

Now, with the lid base piece attached.

With the lid down, and the combination lock fingers holding it closed. Note that central circular fence piece. That started out as a flat ribbon, and you’re supposed to fit the two ends into each other to make the ring. That thing literally self-destructed in my hands. Fortunately, this is when I discovered that the kit included spare parts, and that included having a second fence. I was a LOT more gentle with the backup piece, and managed to fit it into the lid slots without any more drama.

All that’s left now is to make the top lid iris cover. Lots of cutting little pins here, and shaving them flat with the surfaces of the plates. Each of the two assemblies consists of 2 parts each, to create a kind of “insert plate” and a “two-tiered holder tray.” The five wing shapes will make up the iris door inside the insert plate.

The finished iris door assembly, partly opened. The outer top disk rotates to open and close the iris. Looking at this now, I should have been a little more thorough in shaving those pins down flat with the top plate. Oh well. If anyone I show this to complains, maybe I’ll try fixing it in post.

The finished iris door assembly, the elevator compartment keys, and the main box. Almost done.

As I said above, this thing is precision cut, and maybe a bit too precise. Most of the holes for the wooden dowel pins were too tight for the pins to be inserted easily, so I ended up boring them a bit wider with a small phillips head screwdriver. As for the irs door assembly, the notches and fingers didn’t want to align right away. I used my cutter knife to shave a little bit of wood along all the notches. I was careful to not take off too much at any one notch, but when I finished, the lid cover slide into place just a little too smoothly. I might talk myself into using some wood glue to hold the lid in place better. Still it looks really nice.

Back side with the keys in place. It looks better without the keys, so when it’s displayed on a shelf, I set the keys off to the side a ways.

The iris door doesn’t lock shut, but it can’t be used to get to the main inner compartment, either. You can use the little cup here inside the iris to hold a ring or a couple coins.

The markings on the combination dial are off a half turn on all three notch dials. Instead of 4-6-4, which is what the pins are set to, the box unlocks at 3.5-5.5-3.5. Otherwise, no problems. It took me 7-8 hours to finish this kit, and a lot of that time was spent waxing surfaces and cutting little dowel pins. It’s a fun little kit to make, and it’s a good way to teach kids how combination locks and iris doors work, and how to gain physical assembly skills.

But, if you’re looking for a lock box for protecting anything of significant size, this kit isn’t it. It’s a novelty, it’s not supposed to be practical. The dimensions are: 10 cm wide (4″), 14 cm front to back, including the key lengths (5.5″) and 9 cm tall (3.5″). The compartment is 3.5 x 3.5 x 4 cm (1.4″ x 1.4″ x 1.6″).

Thinking About Encryption, Part 34


Thinking About Encryption, Part 34
I really need to learn better. When I say that I’m not going to bother writing my own solver for something that isn’t used very often, I’m probably lying to myself. So, right after finishing the write-up on Route Transportation, I remembered there’s an RT cipher in the July-Aug. issue of the ACA Cm newsletter. I got a copy of that from the ACA digital downloads page, and plugged it into Bion’s Route worksheet. Now, while Bion is an avid cipher programmer, his worksheet pages can be fairly cryptic. They’re powerful, but they really need usage instructions. I spent the better part of an hour trying to figure out what I was doing, and then maybe another 30 minutes trying the various “on-by” and “off-by” combinations by hand before getting the one that provided the solution to the CON. His worksheet automates part of the process, but it’s still up to you to do the bulk of the work to get to the answer.

The more I thought about this, the more I realized that writing my own VBScript solver wasn’t all that unreasonable. I sat down and wrote a proof-of-concept script in about an hour, which could handle “on by rows,” “on by columns,” vertical and horizonal mirror flips, reversed text, “off by rows” and “off by columns.” Just for safe measure, I added “on by rows, right-then-left,” “on by columns, down-then-up”, and the associated “off by rows, right-then-left,” and “off by columns, down-then-up”. The next day, it took me close to six hours to implement “on by diagonal, down and to left,” “on by diagonal, up and to right,” “on by diagonal, down then up,” “on by diagonal, up then down,” “on by clockwise spiral,” and “on by counterclockwise spiral.” Plus the “off by” versions.

The original ACA article said there’s 6 routes, and we can get that if we claim that columns are really rows that are mirror-flipped on the diagonal line, and that diagonal CW and CCW, and spiral CW and CCW are as well. Then we’d have on by rows, on by rows right then left, on by diagonal CW, on by diagonal down then up, on by spiral CW, and crab spiral. The thing is, you can get the crab spiral with str = strReverse(str) and plugging that into on by spiral. Really, that’s 5 on-bys, 5 flips (normal, horizonal, vertical, horiz. and vert., and diagonal) and string direction (normal or reversed), for 50 combinations. Then there’s 5 off-bys, and whether to diagonal flip. I’m not seeing much of a need to apply the vertical or horizonal mirror flips a second time, and off by crab spiral can probably be ignored here because it duplicates one of the other combinations (wrong! see below). I can easily add the second set of flips when the need arises, and as mentioned above, the crab spiral is just the normal spiral plus strReverse. No challenges there (phbbbt. I can be so naive).

To automate the solver, I implemented 4 nested for-loops. The first for str = str, and str = strReverse. The second for all ten of my on-by functions. The third for normal, horizonal flip, vertical flip, flip both. And the fourth for the ten off-by functions. Technically, I could have tested for on-by rows, off-by rows, etc., and skipped those because they don’t do anything. But, the script is so fast that the do-nothing combinations have no effect on run time. I then tested the script on the Route Transposition CON in the July-Aug. issue, and it found the solution immediately. Yay, team Me. I also compared the output of my script with Bion’s worksheet and verified that my script worked right.

Now, what did I learn from all this? First, I write buggy code. But, I already knew that. Second, in doing my initial testing of the on-by, off-by functions, I saved the intermediary array results to just one variable name, and that came back to bite me when I put in the additional for-loops. When I was just checking one phase at a time, having the one variable name made things easier for debugging. In the for-loops, I had to allow for 3 separate intermediary variables, and that took a bit to realize what I’d done wrong.

Ok, as I’m typing this up, it occurs to me that I do have several other RT CONs that I copied to a file from the 2006-2010 ACA archives, and that before I go much farther, I should try my solver on those. So, I copy-paste in the first two CONs, and “boom,” out pop the answers. Great! Then I try the third one, and the first hint I get that something is off about it is there’s no crib. The hint is “fearless feline,” so I guess at “cat” as the crib, and I only get a partial answer out. I copy the CON into Bion’s worksheet and fiddle with the buttons, and that gives me the exact same partial answer. I keep fiddling, and pretty soon realize that it’s a crab spiral, and that neither my, nor Bion’s, approaches actually handle crabs right. Then I notice that on-by-rows and off-by-spiral prints the answer backwards. After applying “strReverse()” to the output, the full solution prints out. I should have added “strReverse” to the off-by output results in my for-loops to begin with.

I finish typing up the above paragraph, and go to the next RT CON I’ve saved from the archives, and not only is there no crib with this one either, it doesn’t follow the ACA guidelines for maximum size. The guidelines suggest nothing bigger than 10×10, and this one is a whopping 11×11. My script was only designed for 10×10, so I end up going through everything and bumping up the arrays I use to 11×11 (this takes a minute and then I’m done). Without a crib, I’m looking at wading through 500+ lines of output, but the hint is “faith-based literature,” and I try using “book” and “faith” as cribs (oddly enough, one of the output lines has the word “change,” and I try that too, but “change” turns out to be just a fluke. “Faith” is the real crib, and the answer pops out again.

The third thing I learned is to test, and test, and test again before assuming I’ve covered all the options. So, I just added a fifth for-loop to print out the results normally, or reversed, and I’ve modified the array sizes. Sigh. I hesitate to do any more testing now…

Wiggles, part 30


Just a little ongoing story to give you something to play with until the next blog post.

BVM KGMMR GWWI XWWG WR BVM WRM OFXM WPMRO JB BVM YJOM WS BVM OBJFGO LMJXFRK HP BW BVM JGNJXM. BVM YJNZ EJLL WS BVM KGMMR GWWI FO IJQYM 1-1.5 IMBMGO LMSB WS BVM XWWG, OW F’X VJCM BW NGJEL IJQYM 5-6 IMBMGO BW KMB BW EVMGM BVM BWP WS BVM OBJFGO SGWI BVM YJG IMMBO BVM NLWOMOB MXKM WS BVM JGNJXM. F’I BJLL, YHB F’I XMSFRFBMLQ RWB J SHLL BEW IMBMGO LWRK, OW F’X RMMX BW NWCMG JB LMJOB 4 BFIMO IQ WER YWXQ LMRKBV YMSWGM F NWHLX YM OHGM BVJB F’X KWBBMR HRXMGRMJBV BVM JGNJXM OPJNM. RJBHGJLLQ, FR BVM XJGZ, EFBV IQ SLJOVLFKVB PWFRBMX XFGMNBLQ FR SGWRB WS IM, FB EJO GMJLLQ VJGX BW KJHKM XFOBJRNM. JSBMG J IFRHBM, FB XJERMX WR IM BVJB BVFO EJO PGWYJYLQ J CMGQ OBHPFX BVFRK F EJO XWFRK. FS BVM BHRRML RJGGWEMX, F’X VJCM J SJFGLQ XFSSFNHLB BFIM JB YJNZFRK HP, WG BGQFRK BW OBWWP HP MRWHKV BW JBBMIPB BHGRFRK JGWHRX. YHB, BVM GWNZ EJLLO EMGM PGMBBQ HRNVJRKFRK, JRX F NWHLXR’B FIJKFRM BVJB BVMGM EJOR’B J NWRRMNBFRK BHRRML HP JVMJX, FS SWG RWBVFRK MLOM BVJR SWG GJFREJBMG XGJFRJKM.

An Gou


Some time after I started writing these blog entries on cryptography, I encountered the Japanese word for “cipher” – 暗号 (angou). The first character translates to “darkness” or “disappear,” and the second is “number.” So, we can say that literally, angou is “dark numbers.” Then, back in July, I made a trip to Osaka, and while I was there I wanted to get something to read in the airport. I picked up a copy of Meitantei Shounan Conan (“Case Closed,” in the U.S.) vol. 94. In it, the characters talk about a secret message, using “angou” to refer to the messages themselves, and not to any specific code or cipher. I was curious as to whether the artist, Gosho Aoyama, was using one of the cipher algorithms I’m familiar with, so I waited until vol. 95 came out, in which the heroes explain their reasoning in identifying the killer.

In short, many years ago, several university students in the film club at their school decided to create their own movie. It was very successful, and helped launch the careers of most of them, either as actors or actresses, scenario writers or special effects artists. One of the group, though, committed suicide soon after. In the present, the remaining friends go to Kyoto, and one by one they start dying. The final victim is to jump to his death at Kiyomizu-dera (one of Kyoto’s most famous temples), the scene of the one guy’s suicide. Each of the victims has some kind of a note with mysterious Japanese characters written on it, and it’s up to Shinichi Kudo to break the code and save the final victim.


(Images used for educational purposes only.)

Eventually, we’re told that the four black squares at the top left of the notes are the key, in that the white cross created by the squares represents the five wards of Kyoto city (north, south, east, west and central). Now, the kanji characters by themselves don’t have any specific meaning, and can be read several different ways. However, if the positioning of the characters on the line can be treated as “above,” “in the middle” or “below,” then that gives us our “up” and “down.” “Left” and “right” come from character pairs in the middle row. The wards in Kyoto are 上京 (Kamigyou (up)), 中京 (Nakagyou (central)), 右京 (Ukyou (left)), 左京 (sakyou (right)) and 下京 (Shimogyou (down)). In Kamigyou ward, we have 坤高 (Kontaka city) and 筋違橋 (Sujikaibashi city). In Nakagyou, there’s 蟷螂山 (Tourouyama city) and 先斗 (Ponto city). In Ukyou, there’s 化野 (Adashino city), and in Sakyou we have 上終 (Kamihate city). What’s not mentioned in the manga as part of the explanation is the appearance of 晒, in Shimogyou, and is read as Sarashi.

The message starts with:
坤..筋
..螂..野終..先
………晒

One special case kanji is 先, in the middle row, which is flipped right-for-left. This represents “Ponto”, but the first three letters are to be read backwards – “npo”. Thus, the first Japanese letter of each kanji – Kon, Rou, Suji, No, Hate, Sarashi and Npo – gives us KO RO SU NO WA SA N…

The rest of the message is “korosu no wa san nin mazu wa shinario da”. “Korosu” = “kill.” “no wa san nin” = “to be of 3 people”. “mazu wa” = “begin with.” “shinario da” = “that’s the scenerio.” Or, “The scenario is that we begin by killing 3 people.”

At the end, we’re told it was all a big misunderstanding. While the guy that committed suicide, Michio Dekuri, had been devastated at not seeing his name in the end credits, in fact, one of his friends had imbedded it as part of the names of the other 4 members of the group. The guy had thought since his friend liked codes and riddles like this, he’d easily spot his name – 出栗 未智男 (Dekuri Michio). The fact that none of the readers are expected to have figured this out is testament to how convoluted all of this is.

Anyway, the first part here is probably closest to a Null cipher, where anything can go. If you know the rule (in this case, “take the first Japanese letter of each kanji as it is read in the names of cities or towns in Kyoto”), then you can read the message. For the second part, you need to cover the upper and lower thirds of the movie screen with your hands, and turn the bits that are revealed into new kanji characters. Again, this may be closest to a Null cipher, or possibly a Grille.

I should also mention one bit that comes during a transition point between storylines. Shinichi’s father suggests that the two names “Asaka” and “Rum” (which are given in English) are connected. Asaka was a character that acted as a bodyguard for someone in an earlier story, and Rum is the second in charge of the Black Organization that wants to kill Shinichi (all of the Black Organization members use alcohol-related code names). Rum is close to the group’s leader, and communicates with everyone else through email. Combining “Asaka” and “Rum”, we get “Karasuma,” (Crow + circle). Renya Karasuma is supposedly the name of the Black Organization’s leader. So, on top of the Null and Grille ciphers, we also have an almost ignorable bit of English anagramming.

Funny enough, in the following chapter, there’s a second use of “angou.” This time, it specifically refers to “a secret message” or “brainteaser.” The story revolves around Shinichi’s classmates (under normal conditions, Shinichi has the body of a child, and needs to attend elementary school all over again with a group of children that fancies themselves to be a detective club). The kids are asked by a teacher to go to the home of Maria Higashio to find out why she missed class that day. Maria’s grandmother has just passed away, and Maria had gone to her house next door for some reason. When the kids reach the grandmother’s house, they find the front door unlocked, and Maria’s shoes and backpack at the front entryway. Additionally, there’s a card taped to the floor, with an arrow and a message reading “Start! Maria-chan gambatte!” (“Gambatte” = “do your best.”)


(“What do you do when you want to put on your make-up?” Opening the mirror changes the apparent direction of an arrow that had just been pointing back to the start point.)

While the messages are called “angou”, they’re really just clues to figure out where the arrows are pointing, in order to locate the next one in the house (in different rooms on various floors). The final arrow points to a special room filled with family home videos and a big screen TV. (Spoiler – the reason Maria hasn’t been seen recently is that her deceased grandfather had built the door to the new room himself, and he’d failed to leave an air gap around the frame. The difference in air pressures inside and outside the room, when the ground floor hallway cools down in the winter, created such a strong suction that the girl had been unable to reopen the door to leave, trapping her there until the other kids figure out the clues and save her.)

Overall, pretty contrived and not all that interesting from a cipher viewpoint. But, this is one of the first examples I’ve encountered for the modern use of the word “angou,” and it gives me the feeling that it’s similar to how most Americans use “code,” “cipher” and “secret message” more-or-less interchangably.

Thinking About Encryption, Part 33


I started diving deeper into the ACA archives, focusing between 2001 and 2005. Along the way I found a couple articles on Route Transposition. To me, RT, Null and Baconian are all very similar in that they’re more like brain teasers than honest ciphers. Granted, they can all be used for hiding messages in various ways, so in that sense, yes, they’re ciphers. But the rules employed seem very arbitrary. In the case of RT, you pick a method for forming a square or rectangle, and then a second method for taking off the cipher text. A few of these methods are actually (close to) the definitions for Columnar Transposition, Scytale, and even Rail Fence. Others are a bit more complicated.

For example, on by rows, off by columns:

thisisa
nexampl
etextab

tnehe tixes aximt spaal b

One obvious weakness of RT is that the plaintext length has to be padded to create an a x b rectangle, which can give away the rectangle’s dimensions and make solving it a bit easier.

The ACA guidelines state that the maximum plaintext lengths are either an 8×8 square, or an 8×10 rectangle. There’s no mention of the types of routes that are available, or are considered “ACA standard.” The ND2005 issue of the Cm lists the six main types: Orthogonal (runs in one direction), Boustrophedon (alternates direction, from the Greek “as the ox turns while plowing”), Diagonal, Spiral (from a corner to the center), Crab Spiral (from the center out to a corner) and Boustrophedon Diagonal. And we have horizontal and vertical mirror flips, so we can rotate the start point around the corners (starting from upper left, upper right, lower left or lower right). In all, there are 48 combinations. And because we can use a different method to take off the text, that’s 48×47 combinations. However, many of the rotations and reflections result in the same ciphertext out.

Say we have “in the worlds of code, there is no one answer”.

Simple orthogonal can be:

inthe . iroee . rewsn
world . nldia . aenoo
sofco . tdesn . nsier
dethe . hstns . ehted
reisn . eohow . ocfos
oonea . wfeoe . dlrow
nswer . ocrnr . ehtni

For simple boustrophedon:

inthe . icone
dlrow . nfdoa
sofco . toeon
ehted . hstns
reisn . edhsw
aenoo . wleie
nswer . orrer

Spiral:

inthe
ereiw
hswso
tnenr
earol
denod
ocfos

Crab Spiral:

htedr
eehoe
rwtcw
eonfs
irion
sldsa
noone

Diagonal

itwlc
nerfh
hooto
wseoa
ddnes
osnne
ioawr

Boustrophedon Diagonal:

inwoo
tercd
hlfen
dotso
shiow
eense
reanr

As can be seen above, the plaintext is still largely readable even after the first transposition. So, if we take off the text in rows or columns, we may retain some of that readability, making it easier to guess the patterns used.

Crab spiral off in columns:

herei sntew orloe htnid odocf osnre wsnae

Losing the spaces, we can find “hereis” at the beginning of the line, and printing the line backwards reveals “answer.” Kind of implies a spiral.

Or, Boustrophedon off in rows:
inthe dlrow sofco ehted reisn aenoo nswer

It’s like we’re not even trying. In fact, this aids in determining the column widths to get us back to our 5×7 rectangle.

In short, you want to avoid maybe 20% of the various “on-by/off-by” combinations just because they leave too many clues. That really reduces the work required by the solver to crack the CON by brute force.

To break a Route Transposition CON, the first step is to get the string length, and determine what the factors are. In my example, I’ve got a length of 35. So, the plaintext is going to be either 5×7 or 7×5. Next, try writing the text in simple rows and columns for both dimensions.

hereisn - On by rows
teworlo
ehtnido
docfosn
rewsnae


herei
sntew
orloe
htnid
odocf
osnre
wsnae


hsohoow - On by columns
enrtdss
rtlnonn
eeoicra
iwedfee


htedr
eehoe
rwtcw
eonfs
irion
sldsa
noone

The first and fourth blocks have the most immediately eye-catching amounts of plaintext.
First, around the outer layer: “thereisnooneanswer”.
Fourth, around the outer layer: “hereisnooneanswer”.

The difference, though, is that when you try to link the letters just before “there”, block four gives you “ted” in the top row, plus “ocfo” in the column immediately below the “d.” Since we know reversed strings are allowed, reversing them gives us “ofcodet”. Put that in front of “hereisnooneanswer”, and we get “ofcodethereisnooneanswer.” This pretty much proves we have a crab spiral, and we know that starts from the center and works out. Obtaining the last of the text is easy.

If we’d kept picking at block one, removing the part we already read, we’d also find:

eworl
ehtnid
docfos

“worlds of code”. Peal that off to reveal:

e
htni

Or, “in the” backwards. Looking more closely at block one, we can finally see that it’s also a crab spiral, just on its side. In fact, blocks one and four are identical, and are simply rotated 90 degrees clockwise.

If that failed, then we would need to form the rectangle using a spiral and/or a diagonal. If the text was 36 characters, we’d have to try a 6×6 square, and a 4×9 rectangle. Still, this is doable with paper and pencil, although brute force in software makes the excerise almost trivial.

I was thinking about writing my own VBScript solver, but the ACA newsletter doesn’t run that many route transposition CONs – maybe one or two a year. BION, one of the ACA’s more active app writers also has a Route worksheet, which I’ll try using next time, first. Overall, though, RT’s may really be more fun to solve by hand (if you can avoid making mistakes).

Some caveats – the routes mentioned above are the obvious ACA-standard ones. You can easily develop non-standard routes, such as “take off every other row,” “every third column,” or “X-diagonals.” One of the other ACA members suggested using magic square numbering, following the jumps of a chess Knight piece, or using a Greek Cross pattern:

. 1 . . 5
2 . 3 6 . 7
. 4 . . 8

and read that off in rows:

1 5 2 3 6 7 4 8

The point is that if you only play with the ACA standard routes, when someone creates a non-standard route, you’ll probably be lost if you rely on software to do the heavy lifting for you.

Summary:
1) Route Transposition is more like a brain teaser than a cipher.
2) There are 6 standard route types, multiplied by rotations and reflections.
3) While there are 48 conceivable standard combinations, some of them give the same results.
4) RT is approachable by hand using paper and pencil.
5) To create an RT cipher, pick the route type for making the rectangle or square, and the route type for pulling the text off for the final cipher. (I.e. – On by reversed rows, off by spiral.)
6) To solve an RT, determine the text length to get the possible rectangle sizes to try (i.e. – 5×5, 6×6 or 4×9).
7) Start by creating the test rectangles on by rows, and on by columns. Look for readable plain text, checking for spirals, crab spirals and diagonals.
8) If #7 fails, write the text in by spiral and by diagonal. Look for reversed plaintext (rows and columns), too.
9) If both #7 and #8 fail, the RT may be non-standard. Consider non-adjacent rows and columns.
10) If all else fails, try making words from the ciphertext letters as anagrams. If you can reconstruct a large block of text this way, it may give you some hints as to the physical relationships between the letters.
11) As a last resort, abandon the idea that this is a Route Transposition and check if you’re not really facing a Rail Fence, Complete Columnar Transposition or Nihilist Transposition instead.

Wiggles, part 29


Just a little ongoing story to give you something to play with until the next blog post.

DTI, LOGSONS SZLS WVQ AOGS KN JBOG IWKL LKQS OJ IWS AVES VNQ ATI OTI IWVI LFTVBS OJ COOQ VNQ PTI KN LZKQS BVKZL VNQ V PTLW-PTLW ZVIAW IO GVMS V LSABSI QOOB. ZOOMKNU VI KI AZOLSB, K AOTZQ ISZZ IWVI CWOSESB KI CVL WVQ QONS UOOQ COBM. VZZ IWS GSIVZ PVBIL CSBS LIKZZ AZSVN VNQ LWKNX, CWKAW CVL V UOOQ IBKAM UKESN WOC JVLI LISSZ BTLIL KN IWS WTGKQ LSV VKB KN RVPVN. VNQ VN SESN DSIISB IBKAM CKIW WOC ABVGPSQ IWKL LPVAS CVL. WOCSESB, IWKL QKQN’I SHPZVKN WOC IWS LKZESBX IWKNU AOTZQ WVES UOIISN PVLI IWS DBOOGL VNQ DOHSL IO USI IO IWS QOOB KN IWS JKBLI PZVAS, CKIWOTI VNXONS SESB NOIKAKNU KI. K PVTLSQ, ZKLISNKNU. NOIWKNU. IWS COBQL “FTKSI VL V UBVES” PZVXSQ KN GX GKNQ, VNQ K LIVBISQ CWKLIZKNU IO IWKNM GOBS AWSSBJTZ IWOTUWIL. CWSN K BSVZKYSQ K CVL LKNUKNU IWS “USUSUS NO MKIVBO” (MKIVBO OJ IWS UBVESXVBQ) “MVBON MOBON” OPSNKNU IWSGS, K FTKI. K BSVAWSQ IWBOTUW IWS WOZS, PTZZSQ IWS NSVBSLI DOHSL V DKI AZOLSB IO IWS AOBNSB, IWSN AZOLSQ IWS LZKQKNU QOOB. K PTI GX DSZI DVAM ON, LITJJSQ IWS PWONS KNIO GX POAMSI, VNQ LIVBISQ ABVCZKNU.