mouse008 wrote:
Thank you! Cloned that repo, and got it to work on my Mac. I must say that (a) it doesn't work with Python2 any more - only Python3, and (b) it required some minor hacking to port it from Linux to Mac. I would need to add conditions to make it running on both Mac and Linux. Here's a sample:
Code:
$ ./token-rng.py
Set PKCS11_LIBRARY to "/Library/OpenSC/lib/opensc-pkcs11.so"
INFO 2016-09-02 00:56:25,705 - token-rng - run_loop: TokenRNG initializing at Fri Sep 2 00:56:25 2016
INFO 2016-09-02 00:56:29,883 - token-rng - run_loop: Random data length: 128 bytes, hex value: b'fe866aa513280bb895dbb0eeaa6ea6194448d631d2d32966f8d6fadc902570e6c784d7a731f5325de5f7fe9716bf328d22e3165fc65c49b227b50761e5fc6e955ccec0271809bf08e8676bc70162e10ada23bf3757eb3815fb843a42543e29c6b7cfa8b1bad0ab0f4e55ab4ea216bc98a403057ce66536ccd1e69f60420bbd24'
INFO 2016-09-02 00:56:30,171 - token-rng - run_loop: Random data length: 128 bytes, hex value: b'f21d9a8247c3832f3dea6d39d083504775dc3d81099674ea2503db97b47d1740f79d1521733fc60551e218ca794a656406be05a52cce4168fd61122ee3b21629f4f2bc4f346a06428d54986bee36fd8b523c751360618aa760412ff321e71b512e45b0e78c62b9207c8a4fab4dbb777390b7272ad7a85cf3189d2aff856d76bf'
I must add that I don't quite understand how token-rng.py was supposed to be used.
Yes, it's Python3-only now. More things are moving that way as well, I just brought this up to it (because the 2.7 versions of some of the dependencies are no longer in the repos, only python3 versions). If you modify it to work sanely on both mac and linux, submit a pull request, the original creator accepted my patch same day (was fairly simple fix, so wasn't much to review). Feel free to email me if you want me to test your fork on linux to make sure that didn't break in the process.