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.
>
>
> https://books.google.com/books?id=r1MoDwAAQBAJ&pg=PA347&lpg=PA347&dq=iusertype,+encrypted&source=bl&ots=Pzp1uneBYE&sig=EB2lf8-mpmfqeho1v-DR_0CVicA&hl=en&sa=X&ved=0ahUKEwiGnt-h97jWAhWD2SYKHWPGAgkQ6AEIFTAD#v=onepage&q=iusertype%2C%20encrypted&f=false
>
> Look at page 340
>
> On Sep 22, 2017 8:09 AM, <[email protected] <javascript:>> wrote:
>
>> Our goal is encrypt some sensitive data in SQL Server Express LocalDB 
>> which does not support TDE 
>> <https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption>
>> .
>> It easy can be implemented  in LocalDB with cryptographic functions 
>> (T-SQL 
>> <https://docs.microsoft.com/en-us/sql/t-sql/functions/cryptographic-functions-transact-sql>),
>>  
>> but we do not know how do it better.
>> Java implementation of Hibernate contains very usefull (for our 
>> situatuion) functions @ColumnTransfer 
>> <https://www.thoughts-on-java.org/map-encrypted-database-columns-hibernates-columntransformer-annotation/>,
>>  
>> does the NHibernate contain analogs?
>>
>> I found some examples like "SQL Server Database Encryption with 
>> NHibernate" 
>> <https://brosteins.com/2014/07/19/sql-server-database-encryption-with-nhibernate-series-part-1-of-5/>,
>>  
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/nhusers.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to