Introduction: Build an Electronic Random Character Generator for One Time Pad Cryptography in Bamboo Case

Picture of Build an Electronic Random Character Generator for One Time Pad Cryptography in Bamboo Case

Foil the NSA!  With this device you can make One Time Pads and create cryptograms that are unbreakable if used correctly. The concept is simple. Create a string of random characters (that is where this device comes in).  Share this string of random characters with a friend. Use the random string to encode a message. Your friend can decode the message using the random characters you shared earlier. If the random string is kept secret, it is theoretically impossible for anyone but you and your friend to read the message. 

Don't wait!  Get your One Time Pad generator here!

https://www.etsy.com/listing/181967530

Step 1: Add the LEDs to the Board

Picture of Add the LEDs to the Board

To start, let's add the LEDs to the board. Start with the four corner LEDs. Once those are soldered add the rest, row by row. Each LED has a flat side which should be aligned with the white outline on the board. I have made it very easy for you since all the LEDs are oriented the same way :). Use a wire cutter or low profile trimmers to clip the leads flush with the board. The green ones shown in the pictures are from the craft section at Wal-Mart and work great. Be sure to save the cut-off LED leads as you will need a few later.

You should now have 15 LEDs soldered and oriented correctly. It is important that they face out straight to match the holes in the case.

Step 2: Add the Coin Battery Clip

Picture of Add the Coin Battery Clip

Adding the battery clip is easy. Place it on the board with the curved edge facing the outside. It should match the outlines on the board. You may find it helpful to temporarily tape the battery clip to the board while you turn it over to solder the bottom side. A quick dab of solder on one terminal while you hold the clip in place works too.

Step 3: Adding the Microcontroller

Picture of Adding the Microcontroller

The microcontroller is the last component to solder. Be sure the end of the microcontroller with the dot is aligned with the white notch of the outline on the board. Double and triple check it is oriented correctly before you solder.

Step 4: Add Battery

Picture of Add Battery

Insert the supplied CR1225 battery (positive side up) into the battery clip. Your One Time Pad Generator is now ready!

Step 5: Touch the Sensor to Generate a Character

Picture of Touch the Sensor to Generate a Character

Just touch the sensor at the top of the board with a finger to start random character generation.

The kits will sleep in low power mode until another touch is sensed.

Step 6: Extend the Touch Sensor

Picture of Extend the Touch Sensor

This simple touch sensor extension will allow you to reach the touch sensor between the bamboo plates easily. Use a couple of the leads which you cut off of the LEDs in the first step. Most any thin wire will do but the cut off LED leads work great. Insert the led about 3mm into the front hole on touch sensor. Holding it in the hole, wrap it around the back of the board. The wrapped around wire should just touch the end you put through the hole. Trim the excess length and solder these two ends together. Do the same with the other touch pad.  You may put a little solder on the front touch pads for extra security as shown in the last picture.

Congratulations!  You are almost done!

Step 7: Assemble Bamboo Case

Picture of Assemble Bamboo Case

The bamboo case is attractive and easy to assemble.  Just follow the pictures and add the pieces in order.  Hand tightening the small nuts is sufficient.

Comments

ItalianJack (author)2014-12-29

Very cool project! I may get me one. You aught to sell it on Tindie.com. It's like etsy, but for electronics stuff.

EtCetera112 (author)2014-03-11

How random is this?

I would be interested to know how you were able to construct a random number generator in such a small space.

sbmull (author)EtCetera1122014-03-11

Ahh yes. That is indeed the magic. ;). I'll let you in on the secret... I found a way to create random bits from the Thermal-Noise of the controller.

https://en.wikipedia.org/wiki/Thermal_noise

I actually did this first with an atmega328, trying to make a USB crypto device. I pulled LOTS of random bits over the USB and subjected them to Diehard testing. They passed.

https://en.wikipedia.org/wiki/Diehard_tests

So I am pretty confident they are random and unpredictable.

Pixelmonster (author)sbmull2014-03-16

Please provide the way you create these random numbers. Because what you explained above is not more than an product assembly instruction. Not an instructable.

minifig904 (author)sbmull2014-03-11

Good start. But, Diehard isn't good enough. Let's see the test results with dieharder.

http://www.phy.duke.edu/~rgb/General/dieharder.php

I'll bet that the thermal noise RNG is putting out biased bits, ie slightly more likely to produce 1 rather than 0 (or vice-versa). But, of course, you probably already knew that, and can tell me in general terms how you're working around it, right?

If you're going to claim it's even remotely useful against the NSA, you're going to have to back your claims.

sbmull (author)minifig9042014-03-11

Thanks for your comments! Dieharder is what I used :). And you are right about bit bias. I take care of that by XORing multiple bits.

Snidely70448 (author)2014-03-15

30 years ago I wrote a program for the Apple IIe in BASIC to print unique one time pads - 2, one of each for encryption and one for decryption - that encrypted two letters at a time. As I remember, I used a built-in random number generator and the time the program was run to create unique pads.

sbmull (author)Snidely704482014-03-16

I guess I am telling my age... My first programs were on an Apple II clone in Applesoft Basic and 6502 machine code. Thanks for sharing!

gentry (author)2014-03-15

Nice pictures. Where can I get the source code?

duncan_a (author)2014-03-11

Well, I've defended many people who have posted projects that serve to gain sales for something, because they've provided sufficient information to build it, but I can't with this one I'm afraid...

There's not even a parts list, much less a schematic or copy of the program code.

This one rates as an assembly guide for a commercial product - it is even stated as such on the linked Etsy page. The only way to build this from the Instructable is to purchase the kit...

This is not in the spirit of Instructables and should be removed.

uwezi (author)duncan_a2014-03-12

...and I wondered if I was the only one missing the schematics and the source code...

It's not an instructable, it's an assembly instruction.

duncan_a (author)uwezi2014-03-12

As the linked Etsy page says "Complete step-by-step assembly instructions can be found here: https://www.instructables.com/id/Build-an-Electronic-Random-Character-Generator-for-1/"

mpthompson (author)duncan_a2014-03-11

I have to agree and this project should be removed from Instructables. There really needs to be a parts list, schematic (and ideally a board layout) as well as full firmware for this project. Otherwise, this is simply an advertisement. It's fine if the kit is available, but only a link to the kit and no implementation details does not make this an "Instructable".

What's more sad is this project went out on the daily Instructables email newsletter so perhaps the editorial policy of this site is changing. I hope not as it will ultimately ruin the value of Instructables if this site simply becomes another conduit for commercial sales. There are plenty of other places on the Internet for that.

thegrendel (author)2014-03-12

Note that for one-time-pad encryption to be secure, the random key must be at least as long as the plaintext message. It would also be nice if you included the microcontroller source code.

riff raff (author)2014-03-11

This is not an Instructable, it's an advertisement. :(

simplebeep (author)riff raff2014-03-11

This Instructable would be much more “in the spirit” if you shared the logic and methods of the device right up-front, or gave some tips as to how to build one of these without purchasing a kit.

epoveda (author)2014-03-08

Very good

bgisborn (author)epoveda2014-03-11

All numbers and letters an be represented in binary form. Working bit by bit you only have to randomly generate 1 or 0. Secondly this device as you explain it does not contain a natural random process-radioactive decay for example. It appears to produce pseudo random numbers

sbmull (author)bgisborn2014-03-11

Thanks for your comment! The device does indeed use a physical sources of randomness in the form of johnson-nyquist noise. You can read about it here:

https://en.wikipedia.org/wiki/Thermal_noise

I actually did this first with an atmega328, trying to make a USB crypto device. I pulled LOTS of random bits over the USB and subjected them to Diehard testing. Every batch passed.

https://en.wikipedia.org/wiki/Diehard_tests

So I am pretty confident the characters are random and unpredictable.

vricsi94 (author)2014-03-11

Interesting instructable, thanks for sharing. The only thing I miss is the method of random character generation, and maybe a source code (if it's open source).

UAVGeek (author)2014-03-11

Just remember that one time pads are just like the name implies. If you share your code with your friend then send him a message he can decode that message. For him to reply he needs to have generated a different code and shared it with you. He dares not use the same code to reply. You can never (ever) use the same code to encrypt another message if you want to ensure unbreakability. So what you want to do is to generate two copies of two different pads. Call one encrypt and one decrypt (for you) and then give your friend a copy of your encrypt pad as his 'decrypt' pad and so on.. Sounds complicated but it's not hard in practice.. er ah.. so I've heard..

Arezus (author)2014-03-11

Good work, looks great.

I would recommend to cover LEDs with red acrylic plate or red semitransparent film - it will make character more readable, I do so for red 7 segment indicators.

lunchweek (author)2014-03-11

With one time pads, I generally use numbers instead of letters. Is it possible to program this device to create numbers?

sbmull (author)lunchweek2014-03-11

Most certainly! I have actually been waiting for this comment. I would be happy to custom program one for you.

lunchweek (author)sbmull2014-03-11

You're awesome! :)

dan3008 (author)2014-03-09

I'd recomend using a button instead of the touch sensor, but other than that :D nice work

sbmull (author)dan30082014-03-09

Thanks for the feedback!

I decided on a touch sensor mainly to keep the component count to a minimum. It also reduces mechanical parts to nil. Also, it allows the same board to be used for the case and case-less kits.

However, I did go through the trouble of designing the touch sensor so that a button can be used to short the touch sensor pads, knowing that someone might want to mod the kit to add a button. An internal pull-up resistor is used so that shorting the pads will not create excessive current.

About This Instructable

27,571views

166favorites

More by sbmull:Binary Thermometer 2.0Rainbow Light$5 Pocket Solar Battery for QRP Radio Transceiver
Add instructable to: