Effectiveness of masking a string
Do not use Dictionary when order matters.

Your code assumes that iterating over Dictionary will yield elements in the order in which they were added, but that's not guaranteed at all (emphasis mine):


  For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair&lt;TKey, TValue&gt; structure representing a value and its key. The order in which the items are returned is undefined.


And even if this wasn't an issue, the intervals logically are not keys and values, so that's another reason not to use dictionary.

In simple cases like this, consider using anonymous type:

var intervals = mask.Split(',').Select(
  element =&gt; new 
  {
      from = Convert.ToInt32(element.Split('-').First()),
      to = Convert.ToInt32(element.Split('-').Last())
  });