-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Searching encrypted values
PostPosted: Tue Feb 15, 2011 5:12 pm 
Newbie

Joined: Thu Jun 14, 2007 6:14 pm
Posts: 15
I know these two things don't usually mix well, but I'm wondering if its still a possibility. My application requirement is to encryped a large string of text, but still allow users to search for it.

I am using Jasypt's encrypted user types to encrypt the data. As I understand, this step happens before the Lucene listeners are invoked, and thus lucene is unable to index the original text. Is there a potential solution in allowing lucene to index the object before the encryption takes place? Perhaps using an interceptor instead of the provided listeners?

Has anyone had this requirement before, or have any ideas on how it could be done?


Top
 Profile  
 
 Post subject: Re: Searching encrypted values
PostPosted: Tue Feb 15, 2011 9:01 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
assuming you're using a two-way encryption, you could create a custom fieldBridge which decrypts the data as needed when adding it into the index.
people won't easily be able to extract text from the index, but it could be possible: maybe store the index on a encrypted partition.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Searching encrypted values
PostPosted: Thu Feb 17, 2011 4:17 pm 
Newbie

Joined: Thu Jun 14, 2007 6:14 pm
Posts: 15
Thanks, I'll definitely look into that. The first question that comes to mind is, can I create a custom FieldBridge through spring? For instance, I would need to inject my encryptor into the fieldbridge in order for it to work. I noticed the annotation takes an impl class which wouldn't really work. Fortunately though I am not using annotations, but I have a feeling the programmatic API will expect a class as well. Do you have any ideas on how I can get around this?


Top
 Profile  
 
 Post subject: Re: Searching encrypted values
PostPosted: Thu Feb 17, 2011 5:21 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
instead of using injection, Spring also provides some static methods to grab instances - like pulling them in instead of having them pushed by Spring.
sorry I don't remember the exact method name.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Searching encrypted values
PostPosted: Fri Feb 18, 2011 10:12 am 
Newbie

Joined: Thu Jun 14, 2007 6:14 pm
Posts: 15
Thanks for the ideas, I noticed that I could implement the ParameterizedBridge interface and pass a value there. Since my programmatic API occurs in a dao that is managed by spring, I can simply inject the encryption manager in the same dao, and pass it to the fieldbridge as a parameter. Thanks!


Top
 Profile  
 
 Post subject: Re: Searching encrypted values
PostPosted: Fri Feb 18, 2011 9:35 pm 
Newbie

Joined: Thu Jun 14, 2007 6:14 pm
Posts: 15
Well it looks like the parameter can only be a string. Thats really unfortunate, I thought I had it figured out.


Top
 Profile  
 
 Post subject: Re: Searching encrypted values
PostPosted: Sat Feb 19, 2011 9:27 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
as I said, use the static helpers from Spring to get a reference

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.