An apparatus in a digital network receives at least one input transport
stream having a plurality of PID streams and outputs at least one
transport streams. The apparatus demultiplexes the at least one input
transport streams and determines whether to: decrypt packets included in
the at least one input transport stream; statistically multiplex a group
of PID streams included in the at least one input transport stream; and
encrypt packets included in the at least one input transport stream.