How can we encode and decode a number x in RSA?
Recall m = pq and
vw = 1 mod (p - 1)(q - 1).
The number x is encoded into y where
y = xv mod m.
Decoding in RSA
The number x is regained from y by means of
x = yw mod m.
Indeed, decoding is the inverse of encoding, as follows from Fermat's little theorem:
Schematically this looks like: