@eyeamgj, yes, they should be reversed.

given that d is public key, e is private key

Let consider A wants to send Msg M to B

then A is calculate** M' = M ^{d} mod n** , B is calculate

**M = (M')**

^{e}mod nbut they give as ** M' = M ^{e} mod n** , B is calculate

**M = (M')**

^{d}mod n

therefore **M** and **M'** are **need to interchange**, otherwise **M' is Plain text** and **M is cipher text**