I'm building a form that will allow my site's users to set a secret question and answer. I'm using NHibernate to persist my model to our database.
public class User {
public string Question { get; set; }
public string Answer { get; set; }
}
I want to encrypt the input from the user before storing it in the database. My first thought was to use a backing field for both properties and perform the encryption or decryption in the getter and setters, but this felt like I was violating SoC.
Is there a better place to transform the data?