Hey guys, I have some questions about the structure of KSA. The way that I find it being explained is as follows:
The first step of this algorithm consist in initializing the S table with the identity permutation: the values in the array are equal to their index. Once the S array is initialized, the next step consist in shuffling the array using the key to make it a permutation array. To do so, we simply iterate 256 times the following actions after initializing i and j to 0: • compute j = j + S[i] + key[i mod keylength] • swap S[i] and S[j] • increment i
So, the way I understand it
Create an array with 256 items, each of the indexes in the array contains value = index , save it as S of i
For i = 0 to 256 (Random number or sequenced numbers?) compute j = j + S[i] + key[i mod keylength] and on for S[j] save the result S of j.
finally swap values of S of i and S of j (All values or just some) - this doesnt make sense in this way, like why would u swap same values on same indexes and that S of i is simple all numbers from 0 to 255
Also, where/how is the key itself generated?