A deterministic scrambling method for improving security of a system by extending a sequence repetition period of a random number sequence (RN 0, RN 1, RN 2,..., RN N) of length n consisting of a plurality (n) of output sequence numbers (1, 2,... 8) to length n*n!, comprising the step of generating a plurality of random numbers (RN 0, RN 1, RN 2,..., RN N) by a random number generator, each random number having a value between 0 and n!-1, where n! is the factorial equivalent of a decimal value representing the total possible values that members of said random number sequence (RN 0, RN 1, RN 2,..., RN N) can equal; and the method further comprising the following steps for each random number RN 1 of said random number sequence (RN 0, RN 1, RN 2,..., RN N): - performing a plurality of residue number system, RNS, arithmetic operations to express RN 1 as a plurality of J RNS residue values (RV0, RV1, RV2, RV3,..., RVJ), each RNS residue value being defined by the following mathematical equation: RV p = RN i ⁢ modulo m p where the moduli m p = m 0 km0, m 1 km1,..., or m J kmJ, are chosen such that m 0 km0 * m 1 km1 *...* m J kmJ is the unique prime factorization of n! and such that said moduli are relatively prime; - converting each of said plurality of RNS residue values (RV0, RV1, RV2, RV3,..., RVJ) to a corresponding different base number system value of a plurality of base number systems (base2, base3, base5, base7, basemJ) so that each of said plurality of J different RNS residue values in said different base number systems (RVO base2, RV1 base3, RV2 base5, RV3 base7, RVJ basemJ,) includes at least one digit; - generating an arbitrary permutation ordering of a plurality of output sequence numbers of a cyclic structure comprising n elements (A, B,..., H) having a circular arrangement, corresponding starting positions (sps) and corresponding output sequence numbers (osns) by using combinations of digits of said plurality of RNS residue values expressed in said different base number systems (RV0 base2, RV1 base3, RV2 base5, RV3 base7,..., RVJ basemJ) as starting positions of the elements (A, B,..., H), wherein said combinations digits are chosen so that the range of values which can be determined by said digits is equal to a number of available unselected elements in said cyclic structure; and - modifying a digital data stream using the output sequence numbers contained in said arbitrary permutation ordering of said plurality of output sequence numbers. - performing a plurality of residue number system, RNS, arithmetic operations to express RN 1 as a plurality of J RNS residue values (RV0, RV1, RV2, RV3,..., RVJ), each RNS residue value being defined by the following mathematical equation: RV p = RN i ⁢ modulo m p where the moduli m p = m 0 km0, m 1 km1,..., or m J kmJ, are chosen such that m 0 km0 * m 1 km1 *...* m J kmJ is the unique prime factorization of n! and such that said moduli are relatively prime; - converting each of said plurality of RNS residue values (RV0, RV1, RV2, RV3,..., RVJ) to a corresponding different base number system value of a plurality of base number systems (base2, base3, base5, base7, basemJ) so that each of said plurality of J different RNS residue values in said different base number systems (RVO base2, RV1 base3, RV2 base5, RV3 base7, RVJ basemJ,) includes at least one digit; - generating an arbitrary permutation ordering of a plurality of output sequence numbers of a cyclic structure comprising n elements (A, B,..., H) having a circular arrangement, corresponding starting positions (sps) and corresponding output sequence numbers (osns) by using combinations of digits of said plurality of RNS residue values expressed in said different base number systems (RV0 base2, RV1 base3, RV2 base5, RV3 base7,..., RVJ basemJ) as starting positions of the elements (A, B,..., H), wherein said combinations digits are chosen so that the range of values which can be determined by said digits is equal to a number of available unselected elements in said cyclic structure; and - modifying a digital data stream using the output sequence numbers contained in said arbitrary permutation ordering of said plurality of output sequence numbers.