Hi Trong
To pick a specific part of string and mask, you no need to write LUA. You can use Affinity as is.
Try below example : --
TRANS PRO=aff, algo=fpe, mtd=rep, key="xyzabcxyz", COPY=(1,4), COPY=(5,2), iterations=12, tweaks=no, flddef1=(name="Source field name", dt=varchar)
------------------------------
Harshavardhan Peddireddy
------------------------------