Coding Tartan

The WOOLPUNK community had a specific and way to encrypt message into their traditional tartan.

Usually Tartan is recorded by counting the threads of each color that appears in the sett. The thread count not only describes the width of the stripes on a set, but also the colors used. For example, the thread count “K4 R24 K24 Y4” corresponds to 4 black threads, 24 red threads, 24 black threads, 4 yellow threads.

W18 K19 W10 K14 W7 K5 W1
W17 K10 W7 K18 W19 K11 W5 K1

In the case of the WOOLPUNK, because we know that message where hide inside the pattern, we try to decrypt it using our alphabet but quickly we realized it was more complicated than that.

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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

18: R 19: S 10: J 14: N 7: G 5: E 1: A = RSJNGEA
17: Q 10: J 7: G 18: R 19: S 11: K 5: E 1: A = QJGRSKEA

A specific property of any tartan is it’s repeatability. Encoding names in any way does pose a problem for tartan-tiles. If we want to encode a name which would result in a non-repeatable pattern, we would need to fill up space to make it repeatable. The only way to do that for any given string without altering it is to add a blank.

At some point we realized that they might have used the gaelic Scottisch alphabet:

A B C D E F G H I L M N O P R S T U
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

If we look at the tartan above, we realize the second color in horizontal and the fifth color in the vertical direction does exceed the gaelic alphabet. With the knowledge of a necessary filler we can try this:

A B C D E F G H I L M N O P R S T U
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

U LPGEA
TLGU MEA

That does not look right. Looking at the Tartan again, we can realize that both directions end with a W/K1. This could be our filler-character to make the tartan repeatable. Using the look-up table in reverse order we can finally decipher the tartans meaning:

A B C D E F G H I L M N O P R S T U
19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

BALFOR
CLOBAIR

In this case the Tartan was encoding the name of Balfor Clobair.

2-chiefWool


The code we used to re-create and verified the name-encoded tartans can be found here:
https://github.com/i-n-g-o/tartanmakername