public void InitializeAesSalt() { Rfc2898DeriveBytes deriveBytes = new Rfc2898DeriveBytes(PrivatePassword, AesInfo.KeySize / 8); AesInfo.Key = deriveBytes.GetBytes(AesInfo.KeySize / 8); SaltData = deriveBytes.Salt; AesInfo.GenerateIV(); }
/// <summary> /// Used for integrity checks /// </summary> public override int GetHashCode() { int hash = Id.GetHashCode(); foreach (Attribute attribute in Attributes) { hash ^= attribute.GetHashCode(); } hash ^= Payload.GetHashCode(); hash ^= AesInfo.GetHashCode(); return(hash); }