Well, either you can override and provide your own GetHashCode() or you can use MD5 to generate a hash based on the value input.
This link talks about GetHashCode():
Link GHC[
^]
and this link talks about MD5:
Link MD5[
^]
PS: I have used MD5 in the past with reasonable success to generate a hash based on the user input value and then store this hash as an "encrypted" password.