Exemplo n.º 1
0
 public static void WriteHeaders(FileStream ciphertext, byte[] salt)
 {
     NullChecks.FileHeaders(ciphertext, salt);
     byte[] memorySizeFlag = Encoding.UTF8.GetBytes(Constants.MemorySizeFlag + Invariant.ToString(Globals.MemorySize));
     byte[] iterationsFlag = Encoding.UTF8.GetBytes(Constants.IterationsFlag + Invariant.ToString(Globals.Iterations));
     byte[] endFlag        = Encoding.UTF8.GetBytes(Constants.EndFlag);
     ciphertext.Write(memorySizeFlag, 0, memorySizeFlag.Length);
     ciphertext.Write(iterationsFlag, 0, iterationsFlag.Length);
     ciphertext.Write(endFlag, 0, endFlag.Length);
     ciphertext.Write(salt, 0, salt.Length);
 }