Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
mongoid-encrypted-fields
Advanced tools
We are actively seeking a new maintainer for this gem! As we no longer use MongoDB as part of our platform, we aren't using the gem for ourselves. As MongoDB and Mongoid continually change, we want to make sure our gem keeps up.
If you're interested, please contact us! Thanks
A library for storing encrypted data in Mongo using Mongoid. We looked at a few alternatives, but wanted something that stored the values securely and unobtrusively.
Mongoid 3 supports custom types that need to only provide a simple interface - allowing us to extend core Ruby types to secure any type while providing a clean interface for developers.
Queries encrypt data before searching the database, so equality matches work automatically.
Mongoid 3, Mongoid 4 and Rails 3.2 are supported in version 1.x of this gem.
```ruby
gem 'mongoid-encrypted-fields'
```
Configure the cipher to be used for encrypting field values:
GibberishCipher can be found in examples - uses the Gibberish gem:
Mongoid::EncryptedFields.cipher = Gibberish.new(ENV['MY_PASSWORD'], ENV['MY_SALT'])
Use encrypted types for fields in your models:
class Person
include Mongoid::Document
field :name, type: String
field :ssn, type: Mongoid::EncryptedString
end
The field getter returns the unencrypted value:
person = Person.new(ssn: '123456789')
person.ssn # => '123456789'
The encrypted value is accessible with the "encrypted" attribute
person.ssn.encrypted # => <encrypted string>
# It can also be accessed using the hash syntax supported by Mongoid
person[:ssn] # => <encrypted string>
Finding a model by an encrypted field works automatically (equality only):
Person.where(ssn: '123456789').count() # ssn is encrypted before querying the database
(c) 2012 Koan Health. See LICENSE.txt for further details.
FAQs
Unknown package
We found that mongoid-encrypted-fields demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.