# What is entropy?

**URL:** <https://forum.openwrt.org/t/what-is-entropy/87282>\
**Category:** Installing and Using OpenWrt\
**Created:** [February 1, 2021, 1:46am UTC](https://forum.openwrt.org/t/what-is-entropy/87282 "2021-02-01T01:46:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cylac](https://forum.openwrt.org/user_avatar/forum.openwrt.org/cylac/32/589_2.png) [@Cylac](https://forum.openwrt.org/u/Cylac)\
**Post date:** [February 1, 2021, 1:46am UTC](https://forum.openwrt.org/t/what-is-entropy/87282/1 "2021-02-01T01:46:27Z")

</div>

Hi, I came across this term when I was configuring my Stats options on my Raspberry pi4 the other day and I still don't really understand what it means. I did find some [sites](https://whatis.techtarget.com/definition/entropy) that talk about it.. but what does it mean for my OpenWRT installation exactly? What is it measuring?

This is a screenshot of my installation for that past day.

 ![Screen Shot 2021-01-31 at 7.04.28 PM](https://forum.openwrt.org/uploads/default/original/3X/8/7/870482a0c410d83ce9748dcd40bce80214066d4c.png)

Thanks

---

<div class="post-metadata">

**Author:** ![dlakelan](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dlakelan/32/2320_2.png) [@dlakelan](https://forum.openwrt.org/u/dlakelan)\
**Post date:** [February 1, 2021, 2:33am UTC](https://forum.openwrt.org/t/what-is-entropy/87282/2 "2021-02-01T02:33:27Z")

</div>

Entropy is how well the cryptographic random number generator in the kernel has been seeded. It should never decrease but misunderstandings early on in kernel development made people think that generating random numbers would "use it up"... When it gets low /dev/random will block, but /dev/urandom wont

---

<div class="post-metadata">

**Author:** ![vgaetera](https://forum.openwrt.org/user_avatar/forum.openwrt.org/vgaetera/32/113586_2.png) [@vgaetera](https://forum.openwrt.org/u/vgaetera)\
**Post date:** [February 1, 2021, 7:03am UTC](https://forum.openwrt.org/t/what-is-entropy/87282/3 "2021-02-01T07:03:21Z")

</div>

- [Entropy (computing)](https://en.wikipedia.org/wiki/Entropy_(computing))
- [Random generator](https://openwrt.org/docs/guide-user/services/rng)

---

<div class="post-metadata">

**Author:** ![hnyman](https://forum.openwrt.org/user_avatar/forum.openwrt.org/hnyman/32/19_2.png) [@hnyman](https://forum.openwrt.org/u/hnyman)\
**Post date:** [February 1, 2021, 7:20am UTC](https://forum.openwrt.org/t/what-is-entropy/87282/4 "2021-02-01T07:20:24Z")

</div>

Getting "true randomness" from outside events can be hard on embedded devices like routers, as there are no external human factors like mouse and keyboard, which could generate new random bits.

In the early years, Linux kernel developers decided to remove network drivers as an entropy source, which made the situation difficult for routers.

See old discussion (from 2011-2014) in [https://dev.archive.openwrt.org/ticket/9631](https://dev.archive.openwrt.org/ticket/9631)

OpenWrt added in 2013 an own patch to ath9k to get entropy from that wifi driver, but some later drivers like mwlwifi have been a bit problematic.  
[https://dev.archive.openwrt.org/changeset/38486.html](https://dev.archive.openwrt.org/changeset/38486.html)

And as there is no hardware clock, the router always starts from the same time, so the urandom contents at boot are semi-deterministic. OpenWrt tackles that since 2016 by keeping a file /etc/urandom.seed that is written after each new boot cycle completes, so that in the next boot the random number generator gets seeded differently.

In general the entropy pool seems to be large enough nowadays. Once we get to kernel 5.6, the whole discussion gets obsolete, as /dev/random should not block any more. From that linked wiki article:

> In October 2016, with the release of [Linux kernel](https://en.wikipedia.org/wiki/Linux_kernel) version 4.8, the kernel's /dev/urandom was switched over to a [ChaCha20](https://en.wikipedia.org/wiki/ChaCha20)-based [cryptographic pseudorandom number generator](https://en.wikipedia.org/wiki/Cryptographic_pseudorandom_number_generator) (CPRNG) implementation[[16]](https://en.wikipedia.org/wiki//dev/random#cite_note-16) by [Theodore Ts'o](https://en.wikipedia.org/wiki/Theodore_Ts%27o), based on [Bernstein](https://en.wikipedia.org/wiki/Daniel_J._Bernstein)'s well-regarded [stream cipher](https://en.wikipedia.org/wiki/Stream_cipher) [ChaCha20](https://en.wikipedia.org/wiki/ChaCha20).
> 
> In 2020, the Linux kernel version 5.6 /dev/random only blocks when the CPRNG hasn't initialized. Once initialized, /dev/random and /dev/urandom behave the same.

---

<div class="post-metadata">

**Author:** ![system](https://forum.openwrt.org/uploads/default/original/3X/7/4/740520c71f00039bbf001045c682f0ecb25e905a.png) [@system](https://forum.openwrt.org/u/system)\
**Post date:** [March 16, 2021, 6:23am UTC](https://forum.openwrt.org/t/what-is-entropy/87282/5 "2021-03-16T06:23:23Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
