What's the difference between spreading and scrambling
Spreading refers to the process of multiplying your data sequence with a higher rate PRN sequence often but not necessary such that one complete duration of a repeating sequence occupies the time duration of one data symbol. For example one such modulation using BPSK to send a “1” you send the entire sequence before it repeats and to send a “0” you send the inverted sequence. Thus the resulting spectrum is “spread” since the resulting BPSK pattern is at a much higher rate.

Scrambling in contrast is multiplying your data with a rate matched PRN sequence. This does not increase the pattern rate but does “whiten” your data which is very useful in many applications such as avoiding long runs of “0” or “1”, and can also help provide security— although linear codes should be avoided for such purposes as they are not very secure.

So to process something as in your figure, the sequence would need to be descrambled by multiplying it with the scrambling code and then it can be despread by multiplying it with the spreading code. This can be done in one step (although less likely) by multiplying with a scrambled spreading code.

The diagram as shown does add a layer of security as long as the scrambling code is not repeating synchronous with the spreading code and the adversary has no access to plaintext.