The return of ex-president: Krypto-Kekkonen

Visual cryptogrphy hiding piece of history

Visual cryptography that hides a piece of history

Due to recent events in world politics, I decided to take a look back and make an implementation of 3D-printed visual cryptography. There were some challenges as original model was designed for printing onto overhead transparencies, which are pretty much obsolete tech today.


Why select Kekkonen for this? Because he is controversial culture icon, and highly recognisableas such. Also because he is remembered by his statesman worthy statements such as  “Saatanan tunarit!” (translates maybe as “you f**kin morons!”)

No, the real reason is that I am not being innovative here; instead I am copying the idea. Sadly the original seems to have gotten lost from the tubes of internets – this 3d-printed-twist may now serve as a tribute to temporally misplaced original.

So what’s the story of “Krypto” there?

Whenever you have a problem, adding more cryptography will not solve it. As I had neither crypto nor problem, this seemed a perfect place to have some.

The idea here is to make an object that contains a hidden message, thus in essence a steganographic piece – with seemingly unbreakable cryptography. How does it work? Easy, we use noise as a key equally long as encrypted data:

  • First layer “key” contains a random dot pattern, so that every bit of noise is represented by two pixels – thus making the first layer always 50% holy.
  • Second layer “data” has bit pattern of first layer xor’ed with data from our single-bit-halftone-low-resolution-of-Kekkonen here.

Now having either layer alone will not reveal anything, as long as the random number generator has been random enough. (in this model it is not, no special attention has been paid to initialize it properly) But when placed carefully over each other, the modulation becomes visible.

Implementation for 3D-printed piece

Transparency-edit vs 3d print edit

Old version with 2×2 pixels, new one with every second line sacrificed for structural support

The original code that creates bitmaps was designed for transparencies. Now in 3d print we need cannot have corner-conneted dots. To overcome this problem, I modified the original code from 2×2 pixels to 1×2 pixel and used the remaining second row as support material.

Having 2 x tiff images containing noise key and data was somewhat easy to translate onto 3d model, below here the full workflow I used on OS X – M$ Windows would be likely easier:

  • Have original image at hand, from here.
  • Starting point

    Starting point

    Use GIMP to edit contrast, lower to one-bit-depth, and scale original image to about 50×60 pixel size

  • Use vck, a python utility to do the crypto stuff from original image, results double size. Btw some pyton libraries had changed form original code (dated at 1998) to an extent requiring minor modifications to code
  • Use GIMP to scale the image up by factor of four, to avoid artefacts in latter part of process
  • Use Inkscape to transform the pixmap to vector graphics so that 3D cad han utilize it
  • Use Tinkercad to import and transform that to STL for 3D-print
  • Use Slic3r to transform STL to gcode for printer, send off to Octoprint to run the show.

Challenges in implementation

I was kinda optimistic when starting the job, and also cautious on how complex the result would be – would the tools be able to crunch it? Mostly, the tools are great – as soon as one finds those right ones, and is willing to accept few minutes of waiting time when up&downloading intermediate results. Below the most annoying limiting factors:

Grayscale version with half-moon encodiing

Grayscale version with half-moon encoding

  • Resolution – regular xerography has way much better detail, thus limiting 3d printed models in complexity. For example using a circular pacman-style pixels to produce grayscale images was out of the question, I tried.

    Grayscale model

    Grayscale print – combined structural and precision failure.

  • Getting first layer print accurately – although I have spent quite some time in fixing autloeveling and calibrating my cartesian printer, it still has problems handling large prints and printing onto the edges near towers. Printer’s hot end ended ripping up that blue scotch painter’s tape from two corners and at the same time it had problems getting the center to stick with the base. (Yes, I print slow, and use blue tape on top of glass – there just for yet unknown reason is 0.2..0.3mm deviation in the print head)
  • Part on bed

    Ready half on print bed

    Tools – when having lengthy tool chain that has not been designed for accuracy, the tools by default want to optimize the trace, thus producing interesting results. I had best results by turning off about all smoothing and optimization options.


With the right angle Kekkonen becomes visible

With the right angle Kekkonen becomes visible

Sad to say, the original transparency edition looks better as this version is almost impossible to see – the result is mostly visible only as a shadow on a wall.

Ideas for further development:

  • Print a relief to the front plate; using a different politician(s) would open up new avenues in thinking
  • Use the same key (front plate) with several data patterns for multiple exposures
High resoluiton shadow

High resolution shadow