leetronics / infnoise Goto Github PK
View Code? Open in Web Editor NEWThis project forked from waywardgeek/infnoise
The world's easiest TRNG to get right
License: Creative Commons Zero v1.0 Universal
This project forked from waywardgeek/infnoise
The world's easiest TRNG to get right
License: Creative Commons Zero v1.0 Universal
Hi, I received three Infinite Noise USB sticks this week and I'm testing them with dieharder.
x200 ➜ ~ sudo infnoise --multiplier 10 | dieharder -g 200 -a
#=============================================================================#
# dieharder version 3.31.1 Copyright 2003 Robert G. Brown #
#=============================================================================#
rng_name |rands/second| Seed |
stdin_input_raw| 7.51e+04 |1364804889|
#=============================================================================#
test_name |ntup| tsamples |psamples| p-value |Assessment
#=============================================================================#
diehard_birthdays| 0| 100| 100|0.23129000| PASSED
diehard_operm5| 0| 1000000| 100|0.00000000| FAILED
diehard_rank_32x32| 0| 40000| 100|0.37159768| PASSED
diehard_rank_6x8| 0| 100000| 100|0.60789942| PASSED
diehard_bitstream| 0| 2097152| 100|0.00000000| FAILED
diehard_opso| 0| 2097152| 100|0.00000000| FAILED
diehard_oqso| 0| 2097152| 100|0.00000000| FAILED
diehard_dna| 0| 2097152| 100|0.56541430| PASSED
diehard_count_1s_str| 0| 256000| 100|0.00000000| FAILED
diehard_count_1s_byt| 0| 256000| 100|0.25930858| PASSED
diehard_parking_lot| 0| 12000| 100|0.00000000| FAILED
diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
diehard_3dsphere| 3| 4000| 100|0.97260166| PASSED
diehard_squeeze| 0| 100000| 100|0.00000000| FAILED
diehard_sums| 0| 100| 100|0.00098605| WEAK
diehard_runs| 0| 100000| 100|0.00000000| FAILED
diehard_runs| 0| 100000| 100|0.00000547| WEAK
diehard_craps| 0| 200000| 100|0.87231322| PASSED
diehard_craps| 0| 200000| 100|0.00000000| FAILED
^C
I started with 10 as this is suggested in /etc/infnoise.conf
. It seems that infnoise is broken for multipliers which are not a factor of four.
x200 ➜ ~ for m in `seq 1000 -1 100`; do echo -n $m; sudo infnoise --multiplier $m | dieharder -g 200 -d 11 | grep diehard_2dsphere; done
1000 diehard_2dsphere| 2| 8000| 100|0.79740406| PASSED
999 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
998 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
997 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
996 diehard_2dsphere| 2| 8000| 100|0.96286276| PASSED
995 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
994 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
993 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
992 diehard_2dsphere| 2| 8000| 100|0.16767338| PASSED
991 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
990 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
989 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
988 diehard_2dsphere| 2| 8000| 100|0.85300938| PASSED
987 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
986 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
985 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
984 diehard_2dsphere| 2| 8000| 100|0.94821266| PASSED
983 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
982 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
981 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
980 diehard_2dsphere| 2| 8000| 100|0.66834763| PASSED
979 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
978 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
977 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
976 diehard_2dsphere| 2| 8000| 100|0.89871392| PASSED
975 diehard_2dsphere| 2| 8000| 100|0.00000000| FAILED
974^C
This happens using version 0.3.0, version 0.2.6 doesn't show this behavior:
x200 ➜ ~ for m in `seq 1000 -1 100`; do echo -n $m; sudo infnoise --multiplier $m | dieharder -g 200 -d 11 | grep diehard_2dsphere; done
1000 diehard_2dsphere| 2| 8000| 100|0.29921090| PASSED
999 diehard_2dsphere| 2| 8000| 100|0.74759359| PASSED
998 diehard_2dsphere| 2| 8000| 100|0.29975106| PASSED
997 diehard_2dsphere| 2| 8000| 100|0.98317491| PASSED
996 diehard_2dsphere| 2| 8000| 100|0.96896072| PASSED
995 diehard_2dsphere| 2| 8000| 100|0.61387792| PASSED
994 diehard_2dsphere| 2| 8000| 100|0.28696629| PASSED
993^C
-- Christophe
I tried installing the .deb
package from the apt repo, the software didn't work because it was apparently built with a newer glibc than what comes with Debian 11. Not sure if this means something needs to be updated in the apt repo or not.
Cloned the code and did make -f Makefile.linux infnoise
to compile the software, then sudo make -f Makefile.linux install
to install everything. This almost worked, but it installed the udev file under /usr/local/lib/udev/rules.d/
, which is not where the system checks when hardware is inserted or removed.
I ended up having to do cd /usr/lib/udev/rules.d ; ln -s /usr/local/lib/udev/rules.d/75-infnoise.rules .
to create a symlink, so the system would see the file and start the service automatically. I've never heard of a system looking for udev files under /usr/local/
before ... maybe that install
line in Makefile.linux
should not be using $(PREFIX)
, and instead have /usr/lib/udev/rules.d/
hard-coded?
If there were a forum/IRC or anything, I'd ask there, but afaict there is none. The packages automatically generate a systemd service. So it won't be compatible with other init systems like OpenRC or runit? Or am I misunderstanding anything about init daemon services or the infnoise driver? Will this differ when compiling from source (because e.g. Gentoo and Void don't have suitable packages anyway)?
Hi, is this project still maintained, last commit was 6 months ago
Similarly to ChaosKey, support for Infnoise by the Linux kernel would be appreciated. In that case Infnoise's random data should be feeded into kernel's LRNG which does the PRNG via ChaCha20 and alike.
Compiling v0.3.2 on oDroid C2 fails where as 0.3.1 compiles fine. Any suggestions would be appreciated.
make -f Makefile.linux
cc -c -o writeentropy.o writeentropy.c -Wall -Wextra -Werror -std=c99 -O3 -fPIC -I Keccak -I /usr/include/libftdi1 -DGIT_VERSION=\"0.3.2\" -DGIT_COMMIT=\"e80ddd78085abf3d06df2e0d8c08fd33dade78eb\" -DGIT_DATE=\"2019-08-12T21:24:02+02:00\" -DLINUX
writeentropy.c: In function ‘readNumberFromFile’:
writeentropy.c:29:29: error: comparison is always true due to limited range of data type [-Werror=type-limits]
while( (c = getc(file)) != EOF
^~
cc1: all warnings being treated as errors
make: *** [Makefile.linux:21: writeentropy.o] Error 1
a lot of applications use /dev/urandom
as source of entropy. Offer to add switch and push data to /dev/urandom
.
Any comments @manuel-domke ?
Errors printed when running systemctl status infnoise :
base) james@james-System-Product-Name:~/Desktop/infnoise/software$ systemctl status infnoise
× infnoise.service - Wayward Geek InfNoise TRNG driver
Loaded: loaded (/lib/systemd/system/infnoise.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2023-03-06 18:00:16 GMT; 8min ago
Process: 96198 ExecStart=/usr/sbin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid (code=exited, status=127)
CPU: 2ms
Mar 06 18:00:15 james-System-Product-Name systemd[1]: infnoise.service: Control process exited, code=exited, status=127/n/a
Mar 06 18:00:15 james-System-Product-Name systemd[1]: infnoise.service: Failed with result 'exit-code'.
Mar 06 18:00:15 james-System-Product-Name systemd[1]: Failed to start Wayward Geek InfNoise TRNG driver.
Mar 06 18:00:16 james-System-Product-Name systemd[1]: infnoise.service: Scheduled restart job, restart counter is at 5.
Mar 06 18:00:16 james-System-Product-Name systemd[1]: Stopped Wayward Geek InfNoise TRNG driver.
Mar 06 18:00:16 james-System-Product-Name systemd[1]: infnoise.service: Start request repeated too quickly.
Mar 06 18:00:16 james-System-Product-Name systemd[1]: infnoise.service: Failed with result 'exit-code'.
Mar 06 18:00:16 james-System-Product-Name systemd[1]: Failed to start Wayward Geek InfNoise TRNG driver.
The provided systemd service will not start.
$ lsusb
Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
$ infnoise -l
ID: 0, Manufacturer: 13-37.org, Description: Infinite Noise TRNG, Serial: 1337-133733r
$ infnoise -D -n
Generated 1048576 bits. OK to use data. Estimated entropy per bit: 0.875594, estimated K: 1.834764
num1s:51.100801%, even misfires:0.098816%, odd misfires:0.181163%
$ sc status infnoise
○ infnoise.service - Wayward Geek InfNoise TRNG driver
Loaded: loaded (/usr/lib/systemd/system/infnoise.service; disabled; preset: disabled)
Active: inactive (dead)
Jan 06 10:31:13 r912 systemd[1]: infnoise.service: Bound to unit dev-infnoise.device, but unit isn't active.
Jan 06 10:31:13 r912 systemd[1]: Dependency failed for Wayward Geek InfNoise TRNG driver.
$ sudo journalctl -b -u dev-infnoise.device
Jan 13 00:28:36 r912 systemd[1]: Condition check resulted in Bridge(I2C/SPI/UART/FIFO) being skipped.
Jan 13 23:31:00 r912 systemd[1]: Expecting device /dev/infnoise...
Jan 13 23:32:30 r912 systemd[1]: dev-infnoise.device: Job dev-infnoise.device/start timed out.
Jan 13 23:32:30 r912 systemd[1]: Timed out waiting for device /dev/infnoise.
Jan 13 23:32:30 r912 systemd[1]: dev-infnoise.device: Job dev-infnoise.device/start failed with result 'timeout'.
$ sc status infnoise.device
○ infnoise.device - /infnoise
Loaded: loaded
Active: inactive (dead)
$ ls -l /dev/infnoise
inode Permissions Size User Group Date Modified Name
1001 lrwxrwxrwx - root root 6 Jan 10:31 /dev/infnoise -> bus/usb/001/004
Running without --daemon
and with --debug
logs the same thing to the journal.
Commenting BindsTo=dev-infnoise.device
and After=dev-infnoise.device
from the service unit lets the unit start.
What is binding the service to a symlink (/dev/infnoise
) achieving here, and is it really required?
Or how do we fix the device unit from dying?
Systemd version: 255.2
Linux r9 6.6.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 02 Jan 2024 02:28:28 +0000 x86_64 GNU/Linux
Hello guys,
I am trying to build on Mojave but here the error I receive :
Undefined symbols for architecture x86_64:
"_inmWriteEntropyEnd", referenced from:
_main in infnoise.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [infnoise] Error 1
Does anybody face this kind of error ? How can I solve it ?
Thank you.
FTDI library files are obviously under the copyright of FTDI and not in the public domain.
Removing their files under software/VisualStudio/ftdi
and replacing it by a README.md file like this will be a better solution:
https://github.com/jj1bdx/infnoise-windows/blob/master/VisualStudio/ftdi/README.md
Is there any plan to support FreeBSD or macOS?
FYI, I've removed the Linux-dependent part and fix the Makefile for the FreeBSD libraries and the code seems to be working fine for FreeBSD 11.2-STABLE. Patch: jj1bdx@3aafc0a
Hello,
It seems that GPG key 71AE099B262DC0B493E6EE71975DC25C4E730A3C expired on 2022-07-23. I could not find renewed one.
The actual problem is with Debian repository:
Err:4 http://repo.13-37.org stable InRelease
The following signatures were invalid: EXPKEYSIG 975DC25C4E730A3C Code Signing Key 13-37.org <[email protected]>
ERROR: cannot verify 13-37.org's certificate, issued by ‘CN=R3,O=Let's Encrypt,C=US’:
Issued certificate has expired.
After ~10 or so generated entropy "chunks" I get the USB read failed. Is this a common problem or something that can affect the entropy pool?
When I execute the command a second time it seems to be up and running (as the systemctl status suggest), but generates an error again after some time.
root@host:~# infnoise --debug --no-output
Generated 1048576 bits. OK to use data. Estimated entropy per bit: 0.877488, estimated K: 1.837174
num1s:50.563373%, even misfires:0.111168%, odd misfires:0.160576%
Generated 2097152 bits. OK to use data. Estimated entropy per bit: 0.875540, estimated K: 1.834695
num1s:50.465626%, even misfires:0.096236%, odd misfires:0.176725%
Generated 3145728 bits. OK to use data. Estimated entropy per bit: 0.874526, estimated K: 1.833406
num1s:50.508445%, even misfires:0.094330%, odd misfires:0.165837%
Generated 4194304 bits. OK to use data. Estimated entropy per bit: 0.875321, estimated K: 1.834417
num1s:50.586397%, even misfires:0.102284%, odd misfires:0.152080%
Generated 5242880 bits. OK to use data. Estimated entropy per bit: 0.875370, estimated K: 1.834479
num1s:50.569753%, even misfires:0.100282%, odd misfires:0.156254%
Generated 6291456 bits. OK to use data. Estimated entropy per bit: 0.875522, estimated K: 1.834672
num1s:50.529542%, even misfires:0.112720%, odd misfires:0.151589%
Generated 7340032 bits. OK to use data. Estimated entropy per bit: 0.874715, estimated K: 1.833645
num1s:50.593377%, even misfires:0.128267%, odd misfires:0.143259%
Generated 8388608 bits. OK to use data. Estimated entropy per bit: 0.875771, estimated K: 1.834988
num1s:50.497163%, even misfires:0.137012%, odd misfires:0.153046%
Generated 9437184 bits. OK to use data. Estimated entropy per bit: 0.875672, estimated K: 1.834863
num1s:50.494457%, even misfires:0.110128%, odd misfires:0.167135%
Generated 10485760 bits. OK to use data. Estimated entropy per bit: 0.875675, estimated K: 1.834866
num1s:50.545596%, even misfires:0.107083%, odd misfires:0.168273%
Generated 11534336 bits. OK to use data. Estimated entropy per bit: 0.875495, estimated K: 1.834637
num1s:50.426698%, even misfires:0.119628%, odd misfires:0.176682%
Error: USB read failed
root@host:~# systemctl status infnoise.service
● infnoise.service - Wayward Geek InfNoise TRNG driver
Loaded: loaded (/lib/systemd/system/infnoise.service; enabled; preset: enabled)
Active: active (running) since Sun 2024-02-11 20:04:51 CET; 5min ago
Docs: man:infnoise.service(8)
Process: 494226 ExecStart=/usr/sbin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid (code=exited, status=0/SUCCESS)
Main PID: 494227 (infnoise)
Tasks: 1 (limit: 9302)
Memory: 596.0K
CPU: 59ms
CGroup: /system.slice/infnoise.service
└─494227 /usr/sbin/infnoise --dev-random --daemon --pidfile /var/run/infnoise.pid
Feb 11 20:04:51 host systemd[1]: Starting infnoise.service - Wayward Geek InfNoise TRNG driver...
Feb 11 20:04:51 host systemd[1]: Started infnoise.service - Wayward Geek InfNoise TRNG driver.
Host is Proxmox 8.1 based on Debian 12. Infnoise installed from Debian bookworm repository.
$ lsusb
Bus 001 Device 007: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
$ sudo infnoise
Error: Can't open Infinite Noise Multiplier.
$ sudo infnoise -l
ID: 0, Manufacturer: 13-37.org, Description: Infinite Noise TRNG, Serial: 1337-XXX
$ sudo infnoise -s 1337-XXX
Error: Can't find Infinite Noise Multiplier with given serial
XXX
replaced because i don't know if it should be secret, --debug
doesn't show any other info
Any changes of getting a new release with the latest changes?
Considering no more development has happened the last year, and no new issues have been reported, it's perhaps a good time to do so.
Host: Ubuntu 20.10
infnoise --version
(from regular ubuntu apt):
GIT VERSION - 0.3.1+dfsg
GIT COMMIT - Debian
GIT DATE - 2019-02-23T17:20:31+00:00
Running infnoise -R
results in rsyslogd
consuming 100% of a core due to the logs being flooded with:
Jul 10 12:53:20 praxis kernel: [1435136.111410] usb 1-2: usbfs: process 614825 (infnoise) did not claim interface 0 before use
config was installed to wrong place. has to be in /lib/systemd/system - not /etc/systemd/
otherwise removing the expected symlink in /etc/systemd doesn't work when doing systemctl disable infnoise
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.