Syndicated Linux NewsThis forum is for the discussion of Syndicated Linux News stories.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to generate a random number from the Linux command line. We will explore how to generate a random number within a range and also a specific length.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by szboardstretcher
Code:
cat /dev/urandom | base64 | head -c 64
Thank you.
I was reading the linked article and was about to suggest that you do the same when I got to the end and realised that, nowhere, had they mentioned the true randomness of the numbers. Your method could be used with a true random number generator or, at least, something like the sound-based one to create the least-predictable numbers your system is capable of.
If you get into a situation where you need 'more' randomness, you can hit up random.org via http or api. They use atmospheric wash to create random readings.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
I'll be honest in that my interest in random, aside from the odd SSH session, is just curiosity. It did occur to me just now, however, that I've a couple of USB SDR devices which ought to be able to find something actually random?
I seem to recall the sound-based one is randomsound?
Sure. But sound isn't as random as might be expected. After a while you will get repetitions in your singular environment. Ie: you sneeze every 4m, heater kicks on 3 times an hour, etc. There are recurring sounds and reasons that your random feed would be psuedo-random or not-random.
I made a random generator years ago that:
Grabbed the news headline of the moment
Converted all the letters to numbers
Grabbed a random subsection of weather data
Converted all the entries to numbers
Did some math on the results and converted to base64
That got me a lot of good random data to mess around with at the time. Not sure I'd do it the same now.
Last edited by szboardstretcher; 04-18-2019 at 01:15 PM.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
I admit I don't know how randomsound works, but I suspect the developers weren't that stupid? Perhaps?
To be fair though, up until now, only stupid "random" systems seem to have been broken.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Have to admit I dobn't recall that exactly but have read of similar over the years.
Perhaps there's a "Schneier's Law" stating that even the best crypto syystem will fall to implementation eventually?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.