Skip to content

Instantly share code, notes, and snippets.

@gayancc
Created November 6, 2015 06:09
Show Gist options
  • Save gayancc/eba8226413765993dfed to your computer and use it in GitHub Desktop.
Save gayancc/eba8226413765993dfed to your computer and use it in GitHub Desktop.
public string CreateSaltKey(int size)
{
var rng = new RNGCryptoServiceProvider();
var buff = new byte[size];
rng.GetBytes(buff);
return Convert.ToBase64String(buff);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment