# Search encrypted data

**URL:** <https://www.ruby-forum.com/t/search-encrypted-data/180505>\
**Category:** Rails\
**Created:** [December 20, 2009, 7:38pm UTC](https://www.ruby-forum.com/t/search-encrypted-data/180505 "2009-12-20T19:38:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [December 20, 2009, 7:38pm UTC](https://www.ruby-forum.com/t/search-encrypted-data/180505/1 "2009-12-20T19:38:19Z")

</div>

I encrypt a few fields in a table. How can I search for data in rails  
and these fields? Can I make a temporary table that is decrypted with  
original text on the fly, which is destroyed after a search?

I encrypt and decrypt in the model, when leaving and fetching data.
