How to get data encrypted when Input into a field

Hello,

The below is a code of one of my field

a!integerField(
label: "Social Security Number ",
labelPosition: "ABOVE",
value: ri!SSN,
saveinto: ri!SSN,
refreshAfter: "UNFOCUS",
required: true,
readonly: false,
validations: {}
)

How to encrypt the data, which is entered as on input into this field? Though when I check the data in record it should be masked ex: the input is 8276, In the record it should display as xxxx but in the database the same field should be encrypted.

  Discussion posts and replies are publicly visible