The reason I did "aAbBcC..." instead of "abc...ABC..." was to increase the chances of randomization between the lower and capital case of each letter since they are next to each other.
this will not increase randomness between upper and lower case.
You can test this with a dice, the places of the numbers will not change the odds of even and odd numbers.
The efficiency
will depend on how you define it. Do you want your code to be more or less readable? Do you need high performance? Maintainability?
In normal cases I wouldn't prefer the one above the other.
Is it best to keep duplicate characters or should I make sure that each character is only encountered once per salt?
actually, the amount of permutations increase if you allow double characters.
This means the string will be harder to crack in a brute force attack.
If you are using this salt for encryption techniques, it's best to use the framework's libraries. Like GetBytes()
:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.rngcryptoserviceprovider.aspx