The function performs a substitution cipher, where certain characters are replaced with other characters while leaving some characters unchanged.

