Let me ask whether my instant simple algorithm has serious flaws ,for cryptography use, or not. Which is supposed to randomly change the order on a given sequence S[1..n] of the length n. Assume I have a good random number generator random() which returns a random integer in the range [1..n].
while true for i in 1..n r=random() swap S[i] and S[r]
If it does not have serious flaws , when can I finish the while loop? Is there any well known algorithm which also easy to write a computer program?
Thank you in advance.