Ruby’s string lib is pretty cool ok:

"babby".tr("A-Ma-mN-Zn-z","N-Zn-zA-Ma-m")
=> "onool"