Skip to content

Commit

Permalink
Merge branch 'master' into doc-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-domke authored Feb 1, 2019
2 parents 68985c0 + 0a2541b commit 4ca9471
Show file tree
Hide file tree
Showing 214 changed files with 2,372 additions and 154 deletions.
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Change Log

## [0.3.0](https://github.com/13-37-org/infnoise/tree/0.3.0) (2018-10-09)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.6...0.3.0)

**Merged pull requests:**

- merge libinfnoise branch [\#12](https://github.com/13-37-org/infnoise/pull/12) ([manuel-domke](https://github.com/manuel-domke))
- Fix apt-key add command in README [\#11](https://github.com/13-37-org/infnoise/pull/11) ([xenomachina](https://github.com/xenomachina))
- Fix a couple of spelling errors [\#10](https://github.com/13-37-org/infnoise/pull/10) ([skitt](https://github.com/skitt))

## [0.2.6](https://github.com/13-37-org/infnoise/tree/0.2.6) (2018-05-02)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.5...0.2.6)

**Closed issues:**

- systemd service can't be disabled [\#7](https://github.com/13-37-org/infnoise/issues/7)

## [0.2.5](https://github.com/13-37-org/infnoise/tree/0.2.5) (2018-04-09)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.4...0.2.5)

## [0.2.4](https://github.com/13-37-org/infnoise/tree/0.2.4) (2018-04-02)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.3...0.2.4)

## [0.2.3](https://github.com/13-37-org/infnoise/tree/0.2.3) (2018-03-02)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.2...0.2.3)

## [0.2.2](https://github.com/13-37-org/infnoise/tree/0.2.2) (2018-03-01)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.0...0.2.2)

## [0.2.0](https://github.com/13-37-org/infnoise/tree/0.2.0) (2018-03-01)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.2.1...0.2.0)

## [0.2.1](https://github.com/13-37-org/infnoise/tree/0.2.1) (2018-03-01)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/v0.2.1...0.2.1)

## [v0.2.1](https://github.com/13-37-org/infnoise/tree/v0.2.1) (2018-03-01)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/v0.2.0...v0.2.1)

**Merged pull requests:**

- Version number [\#5](https://github.com/13-37-org/infnoise/pull/5) ([manuel-domke](https://github.com/manuel-domke))
- Correct CS spelling [\#4](https://github.com/13-37-org/infnoise/pull/4) ([darrellrossman](https://github.com/darrellrossman))

## [v0.2.0](https://github.com/13-37-org/infnoise/tree/v0.2.0) (2017-12-31)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/v0.1.2...v0.2.0)

**Merged pull requests:**

- merged captainpete's pull request \#28 from waywardgeek/infnoise [\#3](https://github.com/13-37-org/infnoise/pull/3) ([manuel-domke](https://github.com/manuel-domke))
- merged "increased timeout and options struct" pull request from runema [\#2](https://github.com/13-37-org/infnoise/pull/2) ([manuel-domke](https://github.com/manuel-domke))

## [v0.1.2](https://github.com/13-37-org/infnoise/tree/v0.1.2) (2017-11-13)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.1.0...v0.1.2)

**Merged pull requests:**

- updated readme [\#1](https://github.com/13-37-org/infnoise/pull/1) ([manuel-domke](https://github.com/manuel-domke))

## [0.1.0](https://github.com/13-37-org/infnoise/tree/0.1.0) (2017-08-29)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/0.1.1...0.1.0)

## [0.1.1](https://github.com/13-37-org/infnoise/tree/0.1.1) (2017-08-29)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/Fourth-OshPark-Prototype...0.1.1)

## [Fourth-OshPark-Prototype](https://github.com/13-37-org/infnoise/tree/Fourth-OshPark-Prototype) (2014-11-02)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/Third-OshPark-Prototype...Fourth-OshPark-Prototype)

## [Third-OshPark-Prototype](https://github.com/13-37-org/infnoise/tree/Third-OshPark-Prototype) (2014-10-15)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/Second-OshPark-Prototype...Third-OshPark-Prototype)

## [Second-OshPark-Prototype](https://github.com/13-37-org/infnoise/tree/Second-OshPark-Prototype) (2014-10-12)
[Full Changelog](https://github.com/13-37-org/infnoise/compare/First-OshPark-Prototype...Second-OshPark-Prototype)

## [First-OshPark-Prototype](https://github.com/13-37-org/infnoise/tree/First-OshPark-Prototype) (2014-10-10)


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ before use in cryptography. This should be done by continually reseeding a
cryptographically secure hash function such as SHA-512, Blake2b, Keccak-1600 (SHA3), or a
stream cipher such as ChaCha. This implementation uses Keccak-1600 with cryptographically
secure reseeding of more than 400 bits of entropy at a time, overcoming a trickle in/out
problem present in the Linux /dev/random system. Users who need many megabytes per second
problem present in the GNU/Linux /dev/random system. Users who need many megabytes per second
of data for use in cryptography can set the outputMultiplier as high as they like, which
causes Keccak to generate outputMultiplier\*256 bits per reseeding by the Infinite Noise
TRNG.
Expand Down
24 changes: 15 additions & 9 deletions software/Makefile.macos
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SHELL = /bin/bash

GIT_VERSION := $(shell git --no-pager describe --tags --always)
GIT_COMMIT := $(shell git rev-parse --verify HEAD)
GIT_DATE := $(firstword $(shell git --no-pager show --date=iso-strict --format="%ad" --name-only))
Expand All @@ -6,9 +8,9 @@ PREFIX = $(DESTDIR)/usr/local

# Against 'libftdi0' from MacOS X ports or brew
#
FTDILOCI = /opt/local/include
FTDILOCL = /opt/local/lib
FTDI= -lftdi
FTDILOCI = $(shell brew --prefix libftdi || echo /opt/local)/include/libftdi1
FTDILOCL = $(shell brew --prefix libftdi || echo /opt/local)/lib
FTDI= -lftdi1

CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -fPIC -I Keccak -I $(FTDILOCI) \
-DGIT_VERSION=\"$(GIT_VERSION)\"\
Expand All @@ -17,7 +19,7 @@ CFLAGS = -Wall -Wextra -Werror -std=c99 -O3 -fPIC -I Keccak -I $(FTDILOCI) \

RM=rm

all: libinfnoise.a libinfnoise.so infnoise
all: libinfnoise.a libinfnoise.so infnoise tools.stamp

infnoise: libinfnoise.a infnoise.o daemon.o
$(CC) $(CFLAGS) -o infnoise infnoise.o daemon.o libinfnoise.a $(FTDI) -lm -L. -L $(FTDILOCL)
Expand All @@ -43,15 +45,19 @@ libinfnoise.so: libinfnoise.o healthcheck.o KeccakF-1600-reference.o

libs: libinfnoise.a

tools.stamp:
$(MAKE) -C tools all
touch tools.stamp

clean:
$(RM) -f infnoise *.o *.a *.gch *.so libinfnoise-example
$(RM) -f infnoise *.o *.a *.gch *.so libinfnoise-example tools.stamp
$(MAKE) -C tools clean

install-lib: libinfnoise.so
install -d $(PREFIX)/include
install -m 0644 libinfnoise.h $(PREFIX)/include
install -d $(PREFIX)/lib
install -m 0644 libinfnoise.so $(PREFIX)/lib
ldconfig $(PREFIX)/lib

install: infnoise
install -d $(PREFIX)/sbin
Expand All @@ -61,6 +67,6 @@ install: infnoise
install -d $(PREFIX)/lib/systemd/system
install -m 0644 init_scripts/infnoise.service $(PREFIX)/lib/systemd/system

postinstall:
systemctl restart systemd-udevd
systemctl enable infnoise
install-tools: install tools.stamp
install -d $(PREFIX)/bin
install -m 0755 tools/bin2hex tools/dice tools/entcheck tools/findlongest tools/flipbits tools/healthcheck tools/hex2bin tools/passgen $(PREFIX)/bin/
129 changes: 65 additions & 64 deletions software/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
Compiling the Driver for Windows
--------------------------------

I compiled infnoise-win.exe using VisualStudio 2013 using Windows 7. I downloaded the
FTD2xx drivers from FTDI. Pipes seem almost entirely broken in Windows, so the Windows
version requires out output file to be specified on the command line. In a cmd window,
you can type

infnoise-win foo

and let it run for a while until you have as much random data in foo as you need.

The VisualStudio project for infnoise is in the infnoise/software/VisualStudio directory.

Using prebuilt packages for Linux
Releases
---------------------------------

Precompiled binaries can be downloaded from the releases section of the 13-37-org fork:
https://github.com/13-37-org/infnoise/releases
Signed packages of release versions are availabe on [Github](https://github.com/13-37-org/infnoise/releases) and [13-37.org](https://13-37.org/files/).

All packages are signed with the same PGP-Key (Key-ID: 0x4E730A3C) used for the repositories below.
Full Fingerprint: 71AE 099B 262D C0B4 93E6 EE71 975D C25C 4E73 0A3C. You can also check the
fingerprints at 13-37.org/pgp-keys and in the Crowd Supply campaign.
The packages are signed with the same PGP-Key (Key-ID: `0x4E730A3C`) used for the apt repositories below.
Full Fingerprint: `71AE 099B 262D C0B4 93E6 EE71 975D C25C 4E73 0A3C`. You can get the keys on [13-37.org/keys](https://13-37.org/keys) and in the [Crowd Supply campaign](https://crowdsupply.com/13-37/infinite-noise-trng).

Repositories for Ubuntu, Debian and Raspbian are also available. To add them follow this procedure:
Verify the keys and add the repo:

$ wget -O 13-37.org-code.asc https://13-37.org/files/pubkey.gpg

# Verify the keys fingerprint:
# GPG1
$ gpg --with-fingerprints 13-37.org-code.asc
# GPG2:
$ gpg2 --import-options import-show --dry-run --import < 13-37.org-code.asc

$ sudo apt-key add 13-37.org-code.asc

Available for Ubuntu and Debian (x86, x64 and armhf):

$ echo "deb http://repo.13-37.org/ stable main" | sudo tee /etc/apt/sources.list.d/infnoise.list
$ sudo apt-get update
$ sudo apt-get install infnoise

Connect the Infinite Noise TRNG (if not already) and the service will be started via a udev rule.
Check status of driver:
Connect the Infinite Noise TRNG (if not already) and the service will be started via a udev rule. Check status of driver:

$ systemctl status infnoise

Compiling the Driver for Linux
Compiling the Driver
------------------------------

It's highly recommended to build from the tagged releases, as these have been [tested and verified](https://github.com/13-37-org/infnoise/tree/master/tests/results) extensively. Note that the releases are maintained in the 13-37-org fork of this project.

To switch to a specific tag:

git clone https://github.com/13-37-org/infnoise
git checkout tags/0.3.0

GNU/Linux
------------------------------

The infnoise application reads random data from the Infinite Noise USB key and writes
Expand All @@ -53,12 +47,17 @@ this command:
$ sudo apt-get install libftdi-dev libusb-dev

These include an open source drivers for the FT240X USB chip used on the Infinite Noise
TRNG. Once this is done, to compile the infnoise program, simply make it:
TRNG. Once this is done, to compile the infnoise program, simply make and install it:

$ make -f Makefile.linux

To run the infnoise application, make sure the Infinite Noise USB stick is
plugged in, and from a shell, type:
To install it, run:

$ make -f Makefile.linux install

This also installs a systemd service and the udev rules described below to start the driver automatically when the device is plugged in.

To run the infnoise application manually, make sure the systemd service is stopped. Otherwise it will restart the daemon and disrupt you.

$ sudo ./infnoise > randbytes

Expand All @@ -70,12 +69,12 @@ Note that there is a newer alpha version of the next release of the libftdi libr
found it runs much slower than the current libftdi1 library in Ubuntu, so I am sticking
with the stable release for now.

Compiling the driver for macOS
MacOS
------------------------------

First install the dependencies, most easily done with homebrew:

$ brew install libftdi-dev libusb-dev
$ brew install libftdi libusb

Adjust the Makefile, if necessary, to point at your ftdi directory:

Expand All @@ -102,41 +101,42 @@ Or you may have to unload the FTDI serial port driver:
Alternatively, FTDI have released the [D2XXhelper](http://www.ftdichip.com/Drivers/D2XX.htm), which may prevent the
serial driver from grabbing the Infinitenoise device.

Usage
The `--dev-random` mode is not implemented for MacOS (yet.)
But you can try the the Infinite Noise [OpenSSL engine](https://github.com/tinskip/infnoise-openssl) based on libinfnoise.

Windows
-----

Usage: infnoise [options]
Options are:
--debug - turn on some debug output
--dev-random - write entropy to /dev/random instead of stdout
--raw - do not whiten the output
--multiplier <value> - write 256 bits * value for each 512 bits written to the Keccak sponge
--no-output - do not write random output data
--daemon - run in the background. Output should be redirected to a file or
the options should be used with --dev-random. To reduce CPU-usage addition
af entropy is only forced after a minute rather than a second.
--pidfile <filename> - write the process ID to a file. If --daemon is used, it is the ID of the background process.
--serial <serial> - use Infinite Noise TRNG/FT240 with the given serial number (see --list-devices)
--list-devices - list available devices
=======
I compiled infnoise-win.exe using VisualStudio 2013 using Windows 7. I downloaded the FTD2xx drivers from FTDI. Pipes seem almost entirely broken in Windows, so the Windows version requires out output file to be specified on the command line. In a cmd window, you can type

infnoise-win foo

and let it run for a while until you have as much random data in foo as you need.

The VisualStudio project for infnoise is in the infnoise/software/VisualStudio directory.

There is also a new fork https://github.com/jj1bdx/infnoise-windows compiled with VS2017.

Usage
-----

Usage: infnoise [options]
Options are:
--debug - turn on some debug output
--dev-random - write entropy to /dev/random instead of stdout
--raw - do not whiten the output
--multiplier <value> - write 256 bits * value for each 512 bits written to the Keccak sponge
--no-output - do not write random output data
--daemon - run in the background. Output should be redirected to a file or
the options should be used with --dev-random. To reduce CPU-usage addition
af entropy is only forced after a minute rather than a second.
--pidfile <filename> - write the process ID to a file. If --daemon is used, it is the ID of the background process.
--serial <serial> - use Infinite Noise TRNG/FT240 with the given serial number (see --list-devices)
--list-devices - list available devices

Note: The options --daemon and --pidfile are only implemented in the Linux version.
-D, --debug - turn on some debug output
-R, --dev-random - write entropy to /dev/random instead of stdout
-r, --raw - do not whiten the output
-m, --multiplier <value> - write 256 bits * value for each 512 bits written to
the Keccak sponge. Default of 0 means write all the entropy.
-n, --no-output - do not write random output data
-p, --pidfile <file> - write process ID to file
-d, --daemon - run in the background
-s, --serial <serial> - use specified device
-l, --list-devices - list available devices
-v, --version - show version information
-h, --help - this help output

Note: The options --daemon, --dev-random and --pidfile are only implemented in the GNU/Linux version.
The windows version is also lacking --list-devices and --serial.

Examples
--------
Expand Down Expand Up @@ -254,21 +254,22 @@ Udev rules
This is thanks to user Abigail on github. If you want to automatically feed
random data into /dev/random when the TRNG is plugged in, you can ask Linux to
do this by creating a file in etc/udev/rules.d.

It relies on the systemd service "infnoise.service" provided under init_scripts, as udev is not designed to start long-running processes.

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", SYMLINK+="infnoise"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015" ,TAG+="systemd", ENV{SYSTEMD_WANTS}="infnoise.service"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", SYMLINK+="infnoise"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015" ,TAG+="systemd", ENV{SYSTEMD_WANTS}="infnoise.service"

This also adds a symlink so the device removal can also be reacted on.

I personally run the infnoise tool by hand from a bash shell, typically to test devices like this:

$ sudo ./infnoise --debug --no-output
$ sudo ./infnoise --debug --no-output

To avoid having to type 'sudo' each time, I created the following udev rules,
which worked on my particular Ubuntu 14.04 based laptop:

$ cat 30-infnoise.rules
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", GROUP="dialout", MODE="0664"
$ cat 30-infnoise.rules
SUBSYSTEM=="usb", ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", GROUP="dialout", MODE="0664"

Note that my username is in the dialout group.
24 changes: 16 additions & 8 deletions software/build-scripts/PKGBUILD.arch
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Maintainer: Manuel Domke <[email protected]>
pkgname=infnoise
pkgdesc='Infinite Noise TRNG'
license=('open')

_pkgname=infnoise

pkgname=${_pkgname}
pkgver=0.2.6.r86.g453234b
pkgdesc="Infinite Noise TRNG - The world's easiest TRNG to get right"
license=('custom:CC0')
url='https://github.com/13-37-org/infnoise'
depends=('libftdi-compat')
makedepends=()
source=('git+https://github.com/13-37-org/infnoise.git')
md5sums=('SKIP')
makedepends=("git")
source=('git+https://github.com/13-37-org/infnoise')
sha256sums=("SKIP")
install='INSTALL'

pkgver() {
cd "${_pkgname}"
git describe --long --tags | sed 's/-/.r/;s/-/./'
}

build() {
cd "${srcdir}/infnoise/software/"
make -f Makefile.linux
Expand All @@ -21,5 +31,3 @@ package() {
install -Dvm644 "${srcdir}/infnoise/software/init_scripts/infnoise.conf.systemd" "${pkgdir}/etc/infnoise.conf"
install -Dvm644 "${srcdir}/infnoise/software/init_scripts/infnoise.service.bin" "${pkgdir}/usr/lib/systemd/system/infnoise.service"
}


Loading

0 comments on commit 4ca9471

Please sign in to comment.