p  =  Prime [20]

q  =  Prime [15]

n  =  p q

e  =  3

d  =  PowerMod [e,  -1,  (p - 1) (q - 1)]

Enc [x_]  :=  PowerMod [x, e,  n]

c  =  Enc [454]

Enc [510]

Enc [%]

BreakEnc [
        c_]  := 
Module [{cN, i,  
          oldcN}, 
oldcN  =  c; 
 
        cN  =  Enc[ c]; 
i  =  
          0; 
While [
          cN  ≠  c, 
 
          oldcN  =  cN; 
  cN  =  
            Enc [cN]; 
i++]; 
{oldcN,  i}]

Enc [232]

BreakEnc [114]

Enc [2]

BreakEnc[8]