Here is a piece of C# code that will make you a secure random string: using System;using System.Collections.Generic;using System.Linq;using System.Security.Cryptography;using System.Text;using System.Windows.Forms; namespace RandomString{ internal static class Program { private static string RandomString(int length, string allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") { if (length < 0) throw new ArgumentOutOfRangeException("length", "length cannot be less than zero."); if (string.IsNullOrEmpty(allowedChars)) throw new ArgumentException("allowedChars may not be empty."); const int byteSize = 0x100; char[] allowedCharSet = new HashSet<char>(allowedChars).ToArray(); if (byteSize < allowedCharSet.Length) throw new ArgumentException(String.Format("allowedChars may contain no more than {0} characters.", byteSize)); // Guid.NewGuid and System.Random are not particularly random. By using a // cryptographically-secure random number generator, the caller is always // protected, regardless of use. using (var rng = new RNGCryptoServiceProvider()) { var result = new StringBuilder(); var buf = new byte[128]; while (result.Length < length) { rng.GetBytes(buf); for (int i = 0; i < buf.Length && result.Length < length; ++i) { // Divide the byte into allowedCharSet-sized groups. If the // random value falls into the last group and the last group is // too small to choose from the entire allowedCharSet, ignore // the value in order to avoid biasing the result. int outOfRangeStart = byteSize - (byteSize%allowedCharSet.Length); if (outOfRangeStart <= buf) continue; result.Append(allowedCharSet[buf%allowedCharSet.Length]); } } return result.ToString(); } } [sTAThread] private static void Main() { Clipboard.SetText(RandomString(2048)); } }} part of the code is from here: http://stackoverflow.com/questions/730268/unique-random-string-generation