// --- create salt ---- private byte[] generateSalt() { PseudoRandom mRandom = PseudoRandom.getInstance(); byte[] content = mRandom.generateRandom(SALT_LENGTH); // Create the file and write to it. // DANGER: System.IO.File.Create will overwrite the file if it already exists. using (FileStream fs = File.Create(saltPath)) { fs.Write(content, 0, content.Length); } return(content); }