# Generation of random numbers (for one-time pads) before 1950ish

**URL:** <https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954>\
**Category:** Factual Questions\
**Created:** [November 3, 2019, 3:53pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954 "2019-11-03T15:53:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [November 3, 2019, 3:53pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/1 "2019-11-03T15:53:18Z")

</div>

How were random numbers generated for one-time pads before the late 1940s, i.e. before radioactive decay, thermal noise, or other fundamentally random phenomena could be readily measured? Physical methods that might have been used before that era such as ‘coin flipping’, dice rolling, or other similar processes will always contain non-random traces which, at least in theory, would render any messages using them quite breakable.

This came up when I was reading about the [Venona Project](https://en.wikipedia.org/wiki/Venona_project) (an interesting thing in itself). Basically, this refers to the organized effort to break high-level Soviet messages that had been encrypted using one-time pads. The break for the decrypters came when it was realized that the Soviets had violated a fundamental tenet of one-time pad encryption by using the same random sequence to encode more than one message. The re-use of one-time pads had occurred circa 1941 as Hitler approached Moscow when, [presumably due to the exigencies of war](https://en.wikipedia.org/wiki/Venona_project#Breakthrough), the factory producing them couldn’t meet demand.

But, back to my question, however the Soviets generated their random numbers before 1941, they seem to have done a very job. AFAIK, only messages (or parts thereof) encrypted with the re-used pads were ever broken. Do we know how they or others of the era would have generated them?

Thanks.

---

<div class="post-metadata">

**Author:** ![Calavera](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calavera/32/70_2.png) [@Calavera](https://boards.straightdope.com/u/Calavera)\
**Post date:** [November 3, 2019, 5:41pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/2 "2019-11-03T17:41:20Z")

</div>

> [@KarlGauss](#):
>
> Physical methods that might have been used before that era such as ‘coin flipping’, dice rolling, or other similar processes will always contain non-random traces which, at least in theory, would render any messages using them quite breakable.

I don’t know enough on the subject to talk further, but this is clearly untrue. Me throwing an (almost) fair die many times is for all intents exactly as unpredictable as me using cosmic radiation to get a choice of 6 possibilities. A die has no memory and the “noise” between throws is something that nobody could ever calculate.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [November 3, 2019, 5:54pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/3 "2019-11-03T17:54:59Z")

</div>

Dice might not be perfect, but they’re a heck of a lot better than you’re assuming.

---

<div class="post-metadata">

**Author:** ![dtilque](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dtilque](https://boards.straightdope.com/u/dtilque)\
**Post date:** [November 3, 2019, 6:05pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/4 "2019-11-03T18:05:58Z")

</div>

> [@Calavera](#):
>
> I don’t know enough on the subject to talk further, but this is clearly untrue. Me throwing an (almost) fair die many times is for all intents exactly as unpredictable as me using cosmic radiation to get a choice of 6 possibilities. A die has no memory and the “noise” between throws is something that nobody could ever calculate.

Yes, but after many uses, an almost fair die could become significantly unfair. The die could wear such that some numbers come up more often than others.

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [November 3, 2019, 6:46pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/5 "2019-11-03T18:46:20Z")

</div>

I’m pretty sure they used a rotating wire basket full of balls with letters on not entirely unlike what you might see in a bingo parlor.

Furthermore, one such basket could definitely have or develop an exploitable bias. However, they probably had more than one.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 3, 2019, 6:50pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/6 "2019-11-03T18:50:30Z")

</div>

Even unfair dice are OK as long as there is some randomness, which you can filter by processing the raw input.

Wanted to mention, the famous “A million random digits” table (1947) used a sort of electronic “roulette wheel” (pulse source). (They indeed had a lot of trouble tuning up the machine and postprocessing the data until it was sufficiently random.) Kendall (1930s) used mechanical devices (an actual rotating disc).

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [November 3, 2019, 7:04pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/7 "2019-11-03T19:04:35Z")

</div>

[Here is a document from 1952](https://www.nsa.gov/Portals/70/documents/news-features/declassified-documents/friedman-documents/reports-research/FOLDER_395/41728419076767.pdf) describing a U.S. device to generate 7 random characters per second. I think the Soviets during W.W.II had a much cruder system, perhaps typists told to peck randomly at their typewriters!

The main problem with using dice would be the slow speed. Precision dice are rather “fair” I think; anyway there are algorithms to convert random numbers with known bias to uniform random numbers.

---

<div class="post-metadata">

**Author:** ![dtilque](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dtilque](https://boards.straightdope.com/u/dtilque)\
**Post date:** [November 3, 2019, 7:23pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/8 "2019-11-03T19:23:34Z")

</div>

> [@DPRK](#):
>
> Even unfair dice are OK as long as there is some randomness, which you can filter by processing the raw input.

How easy is it to apply the filter without computers? There’s a time factor. If it takes a long time to do this filtering, there’s a tendency to skip it in the interest of producing random numbers faster.

> [@septimus](#):
>
> I think the Soviets during W.W.II had a much cruder system, perhaps typists told to peck randomly at their typewriters!

I can’t imagine that producing anything close to being truly random.

---

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [November 3, 2019, 7:37pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/9 "2019-11-03T19:37:07Z")

</div>

> [@dtilque](#):
>
> I can’t imagine that producing anything close to being truly random.

How random did the numbers have to be? The other side didn’t have computers either.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 3, 2019, 8:05pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/10 "2019-11-03T20:05:37Z")

</div>

> [@dtilque](#):
>
> How easy is it to apply the filter without computers? There’s a time factor. If it takes a long time to do this filtering, there’s a tendency to skip it in the interest of producing random numbers faster.

Some of the stuff RAND did, like transforming digits by adding them to the corresponding digits on the previous page, is not that time-consuming, but the need for literally millions of random numbers goes along with the rise of computers to run Monte Carlo simulations that consume that many numbers, so there is not really any problem.

If one merely needs a few random digits for a secret password and is manually flipping a coin or rolling dice, and the die/coin is not too badly loaded, then something like von Neumann’s procedure will increase the number of rolls or flips required by a small constant factor (like 2x or 3x), but even for a few dozen digits, who cares. That procedure also assumes the bias is not changing with time, which seems reasonable for a very small sample.

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [November 3, 2019, 8:40pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/11 "2019-11-03T20:40:00Z")

</div>

> [@dtilque](#):
>
> I can’t imagine that producing anything close to being truly random.

They don’t have to be truly random.  
Just random enough that the enemy de-crypters, using 1940s equipment, could not decode them in time. The ‘in time’ is important – most military messages have a very short value-life, often less than 24 hours. After that, it’s too late for your troops to respond, even if they know what the message said.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [November 3, 2019, 8:56pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/12 "2019-11-03T20:56:04Z")

</div>

> [@Lance\_Turbo](#):
>
> I’m pretty sure they used a rotating wire basket full of balls with letters on not entirely unlike what you might see in a bingo parlor.
> 
> Furthermore, one such basket could definitely have or develop an exploitable bias. However, they probably had more than one.

I’ve seen several references to the Brits using such ball-and-basket systems circa WWII. There’d be 26 numbered balls. Rotate the cage a specified number of times, reach in and pull a ball out. Write the number down. Put the ball back. Repeat.

One huge advantage of this system over dice/coins/etc. is there is no need to work out an awkward encoding into the alphabet size. (And yes, they spelled out numbers and avoided punctuation to keep the alphabet size down. This was a big issue pre-computers.)

Even with ball-and-basket there’s a chance for mistakes to be made. A person might look in before selecting a ball. The wooden balls might not all feel the same. People tend to reject selecting the same number twice in a row despite it being more common than most people think, etc.

Neal Stephenson in _Cryptonomicon_ puts in a fictional incident where one of the women doing the ball-and-basket thing wasn’t doing it right.

Note that one-time pads are sort of in the same mindset to some as security through obscurity (but not really). So one could take a table of random numbers (which had been published widely by that time), and apply a mix of random and Mathematical transformations to it and you have another stream of numbers that _looks_ really random. (Of course it isn’t if you know the protocol and the additional new random numbers aren’t that many.)

---

<div class="post-metadata">

**Author:** ![DrDeth](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@DrDeth](https://boards.straightdope.com/u/DrDeth)\
**Post date:** [November 3, 2019, 9:45pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/13 "2019-11-03T21:45:23Z")

</div>

We used the last two digits of a Phone number in the Phone book, page chosen at random among residences.

---

<div class="post-metadata">

**Author:** ![KarlGauss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/karlgauss/32/3713_2.png) [@KarlGauss](https://boards.straightdope.com/u/KarlGauss)\
**Post date:** [November 3, 2019, 9:55pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/14 "2019-11-03T21:55:10Z")

</div>

Thank you all for your answers.

Part of the reason I was impressed with the success of the Soviet’s ‘primitive’ randomization procedure was that, aside from the few percent of messages decrypted as a result of the page duplication, the huge majority (supposedly) remained uncracked even many years later when more modern electrical/electronic approaches were available to use in attempts to break it. Perhaps that is a reflection of the relatively small amount of traffic available for ‘study’ but I guess it also suggests a pretty decent approximation to random.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [November 3, 2019, 10:22pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/15 "2019-11-03T22:22:13Z")

</div>

Early roulette wheels were made no better than they should be, and with the development of early statistical theory became statistically predictable. The gambling houses realized this at about the same time that statisticians did, and were in the process of replacing their wheels at the same time that early wheel-counters where trying to get rich.

The process for creating truly random numbers for gambling kept pace with attempts to find exploitable patterns in the random numbers created for gambling. Huge sums of money were at stake.

---

<div class="post-metadata">

**Author:** ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)\
**Post date:** [November 3, 2019, 10:52pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/16 "2019-11-03T22:52:24Z")

</div>

> [@ftg](#):
>
> Neal Stephenson in _Cryptonomicon_ puts in a fictional incident where one of the women doing the ball-and-basket thing wasn’t doing it right.

That is probably where I got the idea. It is a novel, but his stuff is usually pretty well researched.

> [@](#):
>
> Root says, “The one-time pads for Detachment 2702 are being created by Mrs. Tenney, a vicar’s wife. She uses a bingo machine, a cage filled with wooden balls with a letter stamped on each ball. She is supposed to close her eyes before reaching into the cage. But suppose she has become sloppy and no longer closes her eyes when she reaches into it.”
> 
> “Or,” von Hacklheber says, “suppose she looks at the cage, and sees how the balls are distributed inside of it, and then closes her eyes. She will subconsciously reach toward the E and avoid the Z. Or, if a certain letter has just come up recently, she will try to avoid choosing it again. Even if she cannot see the inside of the cage, she will learn to distinguish among the different balls by their feel–being made of wood, each ball will have a different weight, a different pattern in the grain.”
> 
> Bischoff’s not buying it. “But it will still be mostly random!”

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [November 3, 2019, 10:53pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/17 "2019-11-03T22:53:47Z")

</div>

> [@KarlGauss](#):
>
> Part of the reason I was impressed with the success of the Soviet’s ‘primitive’ randomization procedure was that, aside from the few percent of messages decrypted as a result of the page duplication, the huge majority (supposedly) remained uncracked even many years later when more modern electrical/electronic approaches were available to use in attempts to break it. Perhaps that is a reflection of the relatively small amount of traffic available for ‘study’ but I guess it also suggests a pretty decent approximation to random.

By ‘primitive’, are you referring to a specific procedure?

I don’t know if those intercepted messages are published, but if they are, since you do have access to electronic computers it would only take you a few moments to analyse the data statistically for randomness (make sure you strip headers and similar and are just feeding in the stream of supposedly-random digits). The SIS did.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [November 7, 2019, 4:36am UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/18 "2019-11-07T04:36:40Z")

</div>

> [@Lance\_Turbo](#):
>
> That is probably where I got the idea. It is a novel, but his stuff is usually pretty well researched.

> [@](#):
>
> "suppose she looks at the cage, and sees how the balls are distributed inside of it, and then closes her eyes.

Which, I suppose, is a reason why real hand-drawn lotteries were never drawn from open cages.

Open cages are an artifact of modern televised machine-drawn lotteries.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [November 7, 2019, 4:51am UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/19 "2019-11-07T04:51:32Z")

</div>

> [@DPRK](#):
>
> Even unfair dice are OK as long as there is some randomness, which you can filter by processing the raw input.

A simple example of this:  
To generate random bits, flip a coin twice. If it comes up HT, output 0. If TH, output 1. Otherwise try again.

It doesn’t matter if the coin is biased as long as it’s independent flip to flip, since P(HT)=P(H)P(T)=P(TH). The technique is ruined if you try to save time by using two coins.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [November 7, 2019, 1:46pm UTC](https://boards.straightdope.com/t/generation-of-random-numbers-for-one-time-pads-before-1950ish/842954/20 "2019-11-07T13:46:43Z")

</div>

You can still save time by using multiple coins, as long as you use the different coins for different bits. For instance, you could generate a penny bitstream in parallel with a nickel bitstream, a dime bitstream, and a quarter bitstream.
