Anyone figured out a good way to pull encrypted values from db through entity framework 4?
I got a MySql db with some columns encrypted with des_encrypt and need to be able to get those values as easy as possible, and also of course, update and insert them.
I think it’s quite strange there doesn’t seem to be in built support for this in EF. Even our own built ORM-system have support for this. We just add a comment “encrypted” for each field thats encrypted and the ORM tool will add des_decrypt(column) and des_encrypt(column) in the queries.
Anyone?
IMO you should encrypt before putting it into the database and store it as binary data. Then you can easily get the
byte[]with EF.EDIT: What if you used a stored procedure to do all the
des_encryptanddes_decryptas well as theselects/inserts/deletesfor you. Then EF will still do the mapping for you?