1 of 19

RF based True Random Number Generator (TRNG)

Tom Broumels

tom.broumels@os3.nl

Philipp Mieden

philipp.mieden@os3.nl

2 of 19

True Random Number Generators (TRNG)

2

OneRNG

It lost, because its name is not fancy enough

https://altusmetrum.org/ChaosKey/

https://github.com/waywardgeek/infnoise

Geiger counter

Infinite Noise

ChaosKey

RTL_SDR Dongle

RTL2832 chipset

DVB-T

Quantis QRNG

HackRF One

… and RF?

3 of 19

TRNG Properties

3

NIST Special Publication 800-90B Recommendation for the Entropy Sources Used for Random Bit Generation

NIST 800-22 Entropy source model

4 of 19

TRNG Testing

4

NIST Special Publication 800-22 Revision 1a: “A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications”

Example Statistical Test Tool (STS) output:

5 of 19

Randomness and SDR

5

  • Receiver signal = Sender signal - Loss + Noise
    • Noise: atmospheric, thermal, radio frequency interference

HackRF

RTL_SDR

6 of 19

Experiment: Raw signal data (different frequencies)

6

https://www.electronics-notes.com/articles/basic_concepts/electronic-rf-noise/radio-frequency-noise-basics.php#:~:text=White%20noise%3A%20White%20noise%20is,all%20frequencies%20of%20interest%20equally.

Without interference: 148 out of 188 tests failed

When sending continuously: 152 out of 188 tests failed → Adding something here?

Conclusion: poor results

Raw signal data

Test

Using

STS

- 433 MHz (IoT, License free)

- 790 MHz (MFCN, PPDR)

- 862 MHz (Telecom)

- 1300 MHz (Aeronautical)

- 1559 MHz (GNSS: Glonass, Galileo)

- 2200 MHz (Space research, Radio Astronomy)

  • 1 MHz (Broadcasting)
  • 5 MHz (Space Research)
  • 10 MHz (Standard frequency and time)
  • 74 MHz (Radio Astronomy / Amateur)
  • 95 MHz (FM)
  • 145.80 MHz (ISS)

https://docdb.cept.org/download/2ca5fcbd-4090/ERCReport025.pdf

Dutch Frequency Table: https://wetten.overheid.nl/BWBR0035791/2020-10-20

7 of 19

Attack Vector - Influencing input

7

https://www.electronics-notes.com/articles/basic_concepts/electronic-rf-noise/radio-frequency-noise-basics.php#:~:text=White%20noise%3A%20White%20noise%20is,all%20frequencies%20of%20interest%20equally.

hackrf_transfer -t 80H.bin -f 433920000 -x 47 -l 40 -g 62

call hackrf_set_sample_rate(10000000 Hz/10.000 MHz)

call hackrf_set_freq(433920000 Hz/433.920 MHz)

No interference:

148/188 tests

failed

Interference:

152/188 tests

failed

8 of 19

Attack Vector - Replication of hardware

8

9 of 19

Randomness Extraction - Von Neumann extractor

9

Bit loss measured between 69% and 94%

Debiasing algorithm works on pairs of bits:

- If the input is 00 or 11: input is discarded (no output)

- If the input is 01: output a 0

- If the input is 10: output a 1

Our implementation with unit tests: https://github.com/dreadl0ck/debias

https://www.esat.kuleuven.be/cosic/blog/co6gc-deterministic-extraction-for-truly-random-bits/

10 of 19

Kaminsky

Debiasing

10

  • SHA256 created from discarded output bytes
  • Hash is used as input for AES256-CBC cipher
  • IV: set to a static value for our experiments
  • Output of encryption is the final result

Kaminsky

Debiasing

11 of 19

Attack Vector: Denial of Service on Von Neumann

11

An attacker could create a signal that decodes to a stream of discarded information:

  • Signal contains large amounts of consecutive zeros or ones
  • Data generation could be blocked, since Von Neumann debiasing outputs no bytes
  • Faraday Cage to defend against interference?
    • No more atmospheric noise!
      • Antenna could be disabled, to only capture thermal noise from device

12 of 19

Attack Vector: Partial Denial of Service on Von Neumann

12

0xFF bytes: 166.4 failed tests on average (SD=5.6)

1.8MB on average (SD=0.2MB/s) per 100MB

No interference: 116.2 failed tests on average (SD=19.8)

26.6MB on average (SD=1.2MB) per 100MB

170,167,161,172,162

120,124,123,128,86

Failed with interference: 166.4 ±5.561 (±3.34%)

Failed without interference: 116.2 ±19.726 (±16.98%)

interf.

2206713,1739470,1753536,1727665,1821945

1849865.8 ±233635.669 (±12.63%)

1.8MB/s (SD = 0.2MB/s)

no interf.

24798401,26747774,27085777,27219614,27206539

26611621 ±1188135.318 (±4.46%)

26.6MB/s (SD = 1.2MB/s)

2.2, 1.7, 1.8,1.7,1.8 = 1.84 ±0.239

8.3,8.9,9.0,9.1,9.1 = 8.88 ±0.493

fileName,bytesIn,bytesOut,duration,sizeDecrease,inputBytesPerSecond,outputBytesPerSecond

100M_interf_0xff_1.bin,100000000,2206713,1.462456817s,-97.79%,100 MB/s,2.2 MB/s

100M_interf_0xff_2.bin,100000000,1739470,1.280736967s,-98.26%,100 MB/s,1.7 MB/s

100M_interf_0xff_3.bin,100000000,1753536,1.384741582s,-98.25%,100 MB/s,1.8 MB/s

100M_interf_0xff_4.bin,100000000,1727665,1.301156558s,-98.27%,100 MB/s,1.7 MB/s

100M_interf_0xff_5.bin,100000000,1821945,1.462163181s,-98.18%,100 MB/s,1.8 MB/s

100M_no_interf_1.bin,100000000,24798401,3.411602953s,-75.20%,33 MB/s,8.3 MB/s

100M_no_interf_2.bin,100000000,26747774,3.398315306s,-73.25%,33 MB/s,8.9 MB/s

100M_no_interf_3.bin,100000000,27085777,3.709802322s,-72.91%,33 MB/s,9.0 MB/s

100M_no_interf_4.bin,100000000,27219614,3.806987751s,-72.78%,33 MB/s,9.1 MB/s

100M_no_interf_5.bin,100000000,27206539,3.775998585s,-72.79%,33 MB/s,9.1 MB/s

SD = Standard Deviation

13 of 19

Results

13

Throughput measurements for our debiasing implementations and NIST tests:

Hardware

Final Output Rate

Failed tests

(out of 188)

RTL_SDR

HackRF

/dev/random

/dev/urandom

rtl_entropy

rfrand

~7.82 MB/s (VN) ~7.0 MB/s (KA)

~4.91 MB/s (VN) ~3.6 MB/s (KA)

0.4 MB/s (SD=0.05)

34.6 MB/s (SD=6.57)

100 - 300 kB/s

900 kB/s - 1.2 MB/s

7-165 (VN) 1-3 (KA)

157-162 (VN) 1-4 (KA)

3-5

1

High entropy signals with VN debiasing only:

  • 74 MHz (Radio Astronomy / Amateur) => 14 failed tests
  • 145.80 MHz (ISS) => 7 failed tests

Random:

481, 467, 420, 370, 398, 374

99% confidence: 418.3333kB/s ±49.357 (±11.80%)

URandom:

38.7, 37.3, 41.2, 37.0,26.9,26.7

99% confidence 34.6333MB/s ±6.569 (±18.97%)

14 of 19

Conclusions

14

  • Signals on the frequencies tested are not random enough to pass the NIST STS test suite unaltered
    • randomness extraction using Von Neumann and Kaminsky can be used

  • RTL_SDR hardware delivered better entropy, due to higher amount of noise, resulting in more bits left after randomness extraction in comparison with the HackRF

  • The random number generator should be able to detect failures and behave in a blocking way if randomness cannot be guaranteed
    • This can be used for Denial of Service attacks, see demo video

  • Alternatives that are less prone to remote influences are appealing alternatives
    • ChaosKey etc
    • Or use proven CSPRNG algorithms and libraries such as Fortuna

15 of 19

Questions?

15

Security and Network Engineering

https://os3.nl

University of Amsterdam

https://uva.nl

Research notes and (CS unverified) TRNG code: https://github.com/dreadl0ck/rf-entropy

16 of 19

Data Rates and Entropy measurements during attacks on Von Neumann debiasing

16

Output rate of random data drops due to discarding in VN

Input entropy drops due to interfering signal

Entropy not affected by attack

10011001

01010101

10011001

01010101

17 of 19

17

Bonus Video: Interfering with Von Neumann debiasing

18 of 19

Bonus: Entropy analysis of raw input data

18

19 of 19

Bonus: Key Prediction attack on Kaminsky Debiasing

19

If an attacker would have a strong RF signal it would allow to:

  • Control the discard buffer that is hashed and used as AES key (eg: 0000000…)
  • Control the output buffer (e.g: 00000...)
    • Allows for known plaintext attacks
  • The security of the final AES encryption is reduced to the used IV (16 byte value)
    • could be recovered with exhaustive search in worst case