diff --git a/README.md b/README.md index 1bddadc..3368259 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -A didactic implementation of the Fortuna cryptographically secure pseudorandom number generator. +A didactic and minimal implementation of the Fortuna cryptographically secure pseudorandom number generator. -Examples only tested in Linux, but they should work also in macOS. ``` $ pip install . @@ -19,25 +18,25 @@ EOF print_pools print_seed_file update_seed_file (fortuna) ``` +In your terminal, a colored tracing will be displayed: + ![screenshot](./docs/screenshot.png) -# Learn specification +The example has only been tested on Linux, but it should work on macOS as well. + +## Learn specification - https://en.wikipedia.org/wiki/Fortuna_(PRNG) -- https://www.schneier.com/academic/paperfiles/fortuna.pdf +- https://www.schneier.com/academic/paperfiles/fortuna.pdf This is a chapter + part of the book `Cryptography Engineering`. Previous chapters will help you + to understand this one. -# Other implementations +## Other implementations +- https://github.com/otms61/fortuna + The base of this project but it seems unmaintained. - https://github.com/seehuhn/fortuna - Interface for entropy sources is easier for user/application. - In `entropy.go` the following functions are defined: - - `func (acc *Accumulator) addRandomEvent(source uint8, seq uint, data []byte)` - It accepts a sequence number instead of pool index. - - `func (acc *Accumulator) allocateSource() uint8` - To ease that 2 sources doesn't share the same identifier. - In line with the book: *allocate source numbers statically or dinamically* - - `func (acc *Accumulator) NewEntropyDataSink() chan<- []byte` - - `func (acc *Accumulator) NewEntropyTimeStampSink() chan<- time.Time` - [pycrypto/Fortuna](https://github.com/pycrypto/pycrypto/tree/65b43bd4ffe2a48bdedae986b1a291f5a2cc7df7/lib/Crypto/Random/Fortuna) - pycrypto/lib/Crypto/Random/Fortuna/ - FortunaAccumulator.py @@ -47,12 +46,4 @@ EOF print_pools print_seed_file update_seed_file - test_FortunaAccumulator.py - test_FortunaGenerator.py - test_SHAd256.py - - https://nvd.nist.gov/vuln/detail/cve-2013-1445 - - `class FortunaPool` - - `which_pool()` function separated from `random_data()` making it more testeable - - seed file not supported - - extensively commented - - `class Util.Counter` - - `FortunaGenerator.max_blocks_per_request` explanation - - `AES` returns integers instead of bytes - https://github.com/freebsd/freebsd-src/blob/main/sys/dev/random/fortuna.c