The right way for columns encryption in NHibernate (like ColumnTransformer in Hibernate for Java).

383 views
Skip to first unread message

isyc...@gmail.com

unread,
Sep 22, 2017, 8:09:57 AM9/22/17
to nhusers
Our goal is encrypt some sensitive data in SQL Server Express LocalDB which does not support TDE.
It easy can be implemented  in LocalDB with cryptographic functions (T-SQL), but we do not know how do it better.
Java implementation of Hibernate contains very usefull (for our situatuion) functions @ColumnTransfer, does the NHibernate contain analogs?

I found some examples like "SQL Server Database Encryption with NHibernate", but those examples are too complex (I think) and contain errors.

Fran Knebels

unread,
Sep 22, 2017, 10:04:25 AM9/22/17
to nhu...@googlegroups.com
I don't like a solution that leverages the underlying database like the link you mentioned. 

This is a much better approach as outlined I  the nhibnerate cookbook.


Look at page 340

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+unsubscribe@googlegroups.com.
To post to this group, send email to nhu...@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

isyc...@gmail.com

unread,
Sep 24, 2017, 6:13:29 AM9/24/17
to nhusers
Thanks for Your answer.
But this solution have one big problem - you can't write SQL requests without keep in mind that search parametrs need encryp before use.
For example:
public Guest TryGetByPhone(ISession session, string phone)
        {
            if (session == null)
                throw new ArgumentNullException("session");

            return session.QueryOver<Guest>()
                          .Where(g => g.Phone == phone)
                          .List()
                          .FirstOrDefault();
        }

variable phone must be encrypted before use.

пятница, 22 сентября 2017 г., 17:04:25 UTC+3 пользователь fknebels написал:
I don't like a solution that leverages the underlying database like the link you mentioned. 

This is a much better approach as outlined I  the nhibnerate cookbook.


Look at page 340
On Sep 22, 2017 8:09 AM, <isyc...@gmail.com> wrote:
Our goal is encrypt some sensitive data in SQL Server Express LocalDB which does not support TDE.
It easy can be implemented  in LocalDB with cryptographic functions (T-SQL), but we do not know how do it better.
Java implementation of Hibernate contains very usefull (for our situatuion) functions @ColumnTransfer, does the NHibernate contain analogs?

I found some examples like "SQL Server Database Encryption with NHibernate", but those examples are too complex (I think) and contain errors.

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages