As per my understanding, you are looking for a solution to encrypt or decrypt the form data.
We got the similar challenge to encrypt or decrypt the values, I am sharing my experience as below.
We have performed our desired operation before data save action. Here we did some customization in Sitecore form fields and written some pipeline that deals with data before save action. This code will update the submitted form data based on some attributed available in specific field.
The solution what we implemented is -
• Addition of Custom attribute - Added custom attribute “Parameters” field so that any field which has this attribute will be considered for encryption/decryption.
<encryptValue>true</encryptValue>
• Write a pipeline for "wffm.submit" - this pipeline will execute before default save action. Here we need to write logic to perform the respective operation. Once an operation is performed, the system will save the value in all targeted place Sitecore tree, mongo or custom database.
<wffm.submit>
<processor type="WFFM.Cusomization RegisterFormSubmitEvent,WFFM.Cusomization" patch:before="processor[@type='Sitecore.Forms.Mvc.Pipelines.Submit.RegisterFormSubmitEvent,Sitecore.Forms.Mvc']"/>
</wffm.submit>
Hope it would help you.