Suppose you have an infinite list of random bytes, and you select the first N bytes that correspond to printable ASCII characters. Is this list of N bytes still as secure (e.g. for the purpose of a crypto secret or salt) as accepting all of the bytes (printable ASCII or otherwise)?
I am basically asking whether this code has any cryptographical weakness:
(Assuming that the output of OpenSSL::Random.random_bytes(1) is indeed random.)