Randomness in secret sharing and visual cryptography schemes