string llRandomBase64(integer number_of_bits)
Generates number_of_bits random bits using a cryptographically secure random number generator (CS-PRNG or true randomness) and encodes them into a Base64 string. If number_of_bits is not a multiple of 6, up to 5 zero-bits are added for padding. The padding bits must not be random. Padding to full bytes is not a good idea, it will just cause people to immediately throw a llGetSubString() on top of this.
SECURITY
If a PRNG is used, its state must not be shared between scripts.
The PRNG may require/support (re-)seeding using a separate function
llSeedRandomBase64(string seed_material)
However, it is not feasible to demand the script to provide all the entropy. This is also why this function is so important for SL scripting.
RATIONALE
Without secure randomness, the use of cryptography in SL is extremely limited. You can use it for non-security-relevant purposes. You can sort-of comply with protocols, though you are undermining their intended security. You can rely on external services, which makes the SL experience more dependent on services that can go away any time.
SAMPLE IMPLEMENTATION
NOTE: Not recommended for practical use because of its weak entropy source.
Attachment seems to get rejected, I hope it accepts a paste: https://pastebin.com/k4Wrquhm