10. SAS-ROS Cipher in SAS-RCS/RBS by: saaiqSAS Last Updated: 27/2/2025 Both the SAS-RCS and SAS-RBS encryption algorithms utilize the SAS-ROS Cipher at their core. However, while the SAS-ROS itself employs a single Dynamic Key and a single Static Key to define a single substitution table, the SAS-ROS implementation within the SAS-RCS/RBS utilizes multiple Static Keys, combined with a single Dynamic Key. This implementation enables the representation of a distinct substitution table for each key pair (1 Dynamic Key + 1 Static Key). During data processing, the available substitution tables are applied in a "1234"/"Round Robin" method for each data unit (i.e., each character in SAS-RCS). Below, in Example 10.1, you can find an accurate representation of this process. It is important to note that the number of Static Keys that can be utilized is not limited. Example 10.1: SAS-ROS substitution with multiple Static Keys Data: aaaaaaa Dynamic key : { c, i, e, a, f, h, b, g, d } Static Key 1: { 4, 8, 2, 7, 1, 6, 0, 5, 3 } Static Key 2: { 6, 1, 7, 0, 3, 5, 8, 2, 4 } Static Key 3: { 3, 8, 0, 6, 7, 5, 4, 2, 1 } Num of available substitution tables: 3 sub-table 1: Dyn Key + St Key 1 sub-table 2: Dyn Key + St Key 2 sub-table 3: Dyn Key + St Key 3 sub-tables distributed to data: 1231231 ROS method 1 passed data: gcbgcbg Notice how in the ROS passed data, 'a's are substituted to different characters when multiple sub-tables are used. As demonstrated in the example above, the use of multiple substitution tables helps mitigate frequency analysis, CCA, and CPA attacks. Furthermore, this implementation significantly increases the overall key space, making brute-force attacks considerably more difficult. ROS in RCS The SAS-RCS encryption algorithm performs character substitution in a monoalphabetic manner (i.e., each character is substituted individually). The Example 10.1 above, as well as Example 10.2 below, illustrates the ROS process for RCS. It is important to note that after the ROS step, the data undergoes an obfuscation process, during which random characters are added at a specified ratio. The output is then shuffled character-wise using all the Static Keys as a source of random numbers. Example 10.2: SAS-ROS substitution in SAS-RCS Dynamic key : { e, b, f, i, a, h, d, c, g } Static Key 1: { 4, 6, 2, 8, 5, 1, 7, 3, 9 } Static Key 2: { 3, 1, 7, 2, 9, 8, 5, 6, 4 } Static Key 3: { 4, 2, 5, 9, 3, 7, 8, 1, 6 } Data: cabbage sub-tables distributed to data: 1231231 ROS m1 output: fgbhghi ROS in RBS Unlike SAS-RCS, the SAS-RBS encryption algorithm substitutes bits using SAS-ROS in a polyalphabetic manner (i.e., groups of bits are substituted). Furthermore, in contrast to SAS-RCS, the Dynamic Key for SAS-RBS consists of these 'groups' of bits as objects, each containing all possible values for a given group length. For example, for a group length of 7 bits, the Dynamic Key will include 128 possible values, ranging from 0000000 to 1111111. Example 10.3 below demonstrates the SAS-ROS step for SAS-RBS with a 4-bit group. It is important to note that before the ROS step in RBS, the data undergoes an obfuscation process, where random bits are added at a specified ratio. Once the ROS processing is completed, the output is shuffled bytewise using all the Static Keys as a source of random numbers. Example 10.3: SAS-ROS Substitution in SAS-RBS for 4-bit Groups Characters are used as Dynamic Key objects and then mapped to binary values. Dynamic Key: { _i, _k, _b, j, _c, _n, _d, a, _m, _l, _h, _p, _o, _f, e, _g } Static Key 1: { 12, _6, _4, 7, 13, _1, _9, 2, 15, _3, 11, 14, _5, 16, 8, 10 } Static Key 2: { _8, 10, 16, 9, _4, 15, 11, 5, _7, 13, 12, _1, _3, 14, 2, _6 } Static Key 3: { 15, _8, 16, 2, _9, _7, _3, 6, _1, 10, 14, _5, 13, 11, 4, 12 } Character to Bit Group Map: 0000 → a 0001 → b 0010 → c 0011 → d 0100 → e 0101 → f 0110 → g 0111 → h 1000 → i 1001 → j 1010 → k 1011 → l 1100 → m 1101 → n 1110 → o 1111 → p Data: 110010101110011100010110 Data Split into Groups of 4 Bits: 1100|1010|1110|0111|0001|0110 Sub-tables Distributed to Data: 123123 ROS Method 1 Processed: 0100|1011|1110|0111|0110|1111 Output: 010010111110011101101111 After this step, the 'output' will undergo bytewise shuffling. Since random bits are added to the data before the ROS step, even a single bit will alter the final substituted value.