Loading

Cipher Grid Generator

by ridercz, published

Cipher Grid Generator by ridercz Jun 30, 2017

Design Tools

OpenSCAD

Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

506Views 129Downloads Found in Games

Summary

Grid Cipher (sometimes also called a grid code) is very simple transposition block symmetric encryption algorithm. It is not usable for any serious cryptography nowadays, but still can be used for games and entertainment.

Traditionally, the grids are created by hand by cutting them from paper. But this process is tedious and prone to errors. So I automated it using 3D printer.

This SCAD file will randomly generate a valid cipher grid each time it's rendered. See variables in source code for customization options. For your convenience, there are several pre-generated grids available for download, if you don't have OpenSCAD installed.

Print Settings

Printer Brand:

Prusa

Printer:

Prusa Mk2

Rafts:

No

Supports:

No

Resolution:

0.2 mm


Notes:

I recommend that you print this model three layers tall. The default settings are for 3 x 0.2 = 0.6 mm height.

Post-Printing

How To Encrypt

  1. Place the grid on paper and remember its orientation. Use the smooth/rough side difference and the round keying hole to note the position.
  2. Write letters of your message to the square holes.
  3. When you fill in all holes, spin the grid 90° and continue writing.
  4. You have to write message which is exactly 100 characters long (for 10x10 grid). If your message is shorter, pad the rest with gibberish. If longer, continue writing another square.

How To Decrypt

  1. Obtain the same grid that was used for encryption.
  2. Place it over the encrypted text in the same orientation as when encrypted.
  3. Read letters showing trough holes.
  4. Spin the grid 90° and continue reading.

How I Designed This

8x8 grid layout scheme

The design of the cipher grid is simple, see the scheme above. The grid is divided into four quadrants. The cells are numbered (see the numbers as index for row and column, ie. "23" in the top right quadrant is row 2, column 3). When the grid is rotated by 90°, hole made in the cell will move to cell with the same number in the next quadrant.

The algorithm to create the code grids is therefore simple: for each position (from "11" to "44" in the picture above) select randomly a quadrant where the hole will be placed. In the code, there are two loops for ix and iy (as in index x and index y) variables and the cx and cy (center x/y variables are determined to compute center of the hole, relative to the quadrant). The iq variable, which determines quadrant, is selected randomly, as is therefore the real placement of the hole.

The outermost cell ("44" in the scheme above) is given a bit of special treatment. I need to place the keying hole (which will allow to note the grid rotation) somewhere. I put it into top right corner of the grid (quandrant 0). However, if the last cell hole is placed in Q0, the key hole is moved to Q2.

More from Games

view more

All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App
Top