“Go” And Find Gold Bug

--

I have a deep love of cracking ciphers, and I love the Go programming language, so let’s “Go” in hunt of gold bug.

The Gold-Bug cipher has included in a short story by Edgar Allan Poe and which was published in 1843. It tells the tail of William Legrand and how he was bitten by a gold-colored bug. In the book he writes:

Here Legrand, having re-heated the parchment, submitted it to my inspection. The following characters were rudely traced, in a red tint, between the death's-head and the goat:53‡‡†305))6*;4826)4‡.)4‡);806*;48†8¶60))85;1‡(;:‡*8†83(88)5*†;
46(;88*96*?;8)*‡(;485);5*†2:*‡(;4956*2(5*—4)8¶8*;4069285);)6†8
)4‡‡;1(‡9;48081;8:8‡1;48†85;4)485†528806*81(‡9;48;(88;4(‡?
34;48)4‡;161;:188;‡?;

The mapping is fairly easy to discover, as we can do a simple frequency analysis. First we can write a Go program to analyse the frequencies:

This gives:

5 12
2 5
- 1
T 8
8 33
1 8
3 4
4 19
6 11
, 0
7 0
0 6
9 5
* 13
I 16
. 1
$ 0
( 10
) 16
; 26
? 3
P 2
] 0
C 0
: 4
[ 0

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.