You could use a trigger to encode during insert and then use a view to decode during select.
However, what I suspect you want is "data masking" functionality for GDPR or other compliance purposes.
The best way to do this is with Security Roles and VIEWs.
First, create a Role for HR - say they can SELECT all cols on Customer and UPDATE their private info.
Second, create a VIEW called Customer_Masked something like this:
SELECT first_name, last_name, IF('HR' =
(
FROM parasql_users JOIN parasql_roles ON (parasql_roles.role_id = parasql_users.role_id)
WHERE user_id = SUBSTRING_INDEX(SESSION_USER(), '@', 1)
), ssn, 'xxx-xx-xxxx') as ssn_masked
From Customers