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

  • Home
  • SEARCH
  • 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 6147195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:04:12+00:00 2026-05-23T19:04:12+00:00

I want to encrypt database because confidential data is being stored. I use mongodb

  • 0

I want to encrypt database because confidential data is being stored. I use mongodb with mongoid. It possible for this kind of database? And what alternatives can you recomend, if it is not?

P.S. Main purpose is: if anybody hack the server and steal DB, it would be unencryptable.

UPDATE: thanks for nickh, I found very many soultions for ActiveRecord, but nothing for Mongoid and other Mongo clinets. It would be great to find some soultion for Mongo and Mongoid!

  • 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-23T19:04:13+00:00Added an answer on May 23, 2026 at 7:04 pm

    I have gotten attr_encrypted working with Mongo and Mongoid. It takes only a few tweaks.

    Make sure that all of the encrypted_ fields that are automatically created by attr_encrypted are explicitly created in the model. For instance, if you have:

        attr_encrypted :email, :key => 'blah blah blah', :encode => true
    

    you need to have:

        field :email, :type => String
        field :encrypted_email, :type => String
    

    Also notice you need to tell it to encode the encrypted string otherwise Mongo will complain loudly.

    Lastly, if you’re encrypting a hash, do this:

        field :raw_auth_hash, :type => Hash
        field :encrypted_raw_auth_hash, :type => String
    
        attr_encrypted :raw_auth_hash, :key => 'blah', :marshal => true, :encode => true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is the following: In an existing database I want to encrypt data
I want to encrypt the SQLite database in my QT application. This tutorial: http://www.qtcentre.org/wiki/index.php?title=Building_QSQLITE_driver_with_AES-256_encryption_support
Is there any javascript function that can encrypt data: For example i want to
I am trying to encrypt an email body to be stored at database, and
I'm currently developing an Android game which saves data into a SQLite database. This
I want to use that session state, because Inproc is unreliable. I need to
I want to encrypt sql server database files (2008) I want to make a
Disclaimer Yes, I know: don't use PASSWORD(password) to encrypt passwords . I don't want
I want to store login and password in sqlite database. This database in encrypted
I want to encrypt/hide my connection string in my database.java class. I allready searched

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.