I'm trying to understand which cryptographic algorithm is this
That would appear to be RC4, which is a well known (if not well trusted) cryptographical algorithm, original designed by Ron Rivest.

The part you quoted is the Key Setup Algorithm, which is run before you actually encrypt/decrypt anything.  The part which is written in an unusual (but correct) way is the last 5 lines, which does a swap of cdict[i] and cdict[v1] - more typically, it is written with just 2 reads and 2 writes and two temp variables in the obvious fashion; for some reason they decided to use some 'clever' logic with xors (and two temp variables, 4 reads, 3 writes).