Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:21:53+00:00 2026-05-29T20:21:53+00:00

My application has a requirement that we need to encrypt index fields. Right now

  • 0

My application has a requirement that we need to encrypt index fields. Right now the encryption/decryption is handled at the application level. I want to move the encryption process away from the application layer so I don’t have to manually encrypt data in model or in the query.

I want to decorate the model with attributes to determine if the field should be encrypted or not. I was looking at using IDocumentConversionListener to handle the conversion to and from a document. Is this the best place to handle this? If so, how do I encrypt/decrypt only the fields with attributes in a complex model? Below is an example of the model with two fields that need to be encrypted.

    public class User
    {
        public string Id { get; set; }
        [EncryptAttribute]
        public string Name { get; set; }
        public Contact PhoneNumber { get; set; }
        public class Contact
        {
            public string Type { get; set; }
            [EncryptAttribute]
            public string Value { get; set; }
        }
    }

public class SecureFieldListener : IDocumentConversionListener
{
   public void EntityToDocument(object entity, RavenJObject document, RavenJObject metadata)
   {

   }
   public void DocumentToEntity(object entity, RavenJObject document, RavenJObject metadata)
   {

   }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:21:54+00:00Added an answer on May 29, 2026 at 8:21 pm

    As for how to store documents encrypted, look here: http://daniellang.net/document-level-encryption-in-ravendb/

    Encrypting the indexes at a high level (above lucene) has a lot of severe problems and I’m pretty sure that you don’t want to do that. Range queries wouldn’t work, ordering would be broken, full-text search impossible, etc.

    Please note that by default, raven stores fields inside lucene without field storage. That means, while you can use them in queries, you can’t actually retrieve their value back as a search result. However, I understand that in very secure environments this might not be sufficient, as it could be possible to extract them somehow though.

    So if you really need such high security, I suggest you go for one of the following option:

    • Don’t use indexes
    • Encrypt the index folder in ravens server at filesystem level (e.g. using TrueCrypt)
    • Extend RavenDB, so that it uses your own lucene FSDirectory implementation, that uses a symmetric algorithm for all disk I/Os
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hosted web application that has MongoDB as its DB. Now, I
I have a web application that has a requirement to take data from an
We need to write an application that has two parts: One side of the
I am a bit confused: We have a chat application that has a requirement
I have a web application in Spring that has a functional requirement for generating
My application has a need to let the user choose a date from a
My application has a plug-in model that allows third-party developers to write assemblies that
Our application has many controls that are created dynamically. For example, a navigation pane
I have an application which has the requirement, but infrequent usage, of uploading an
I'm using a Facebook application that has a rich set of information that I'd

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.