
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
NmDatafile is a library that defines a file format that makes adding files and strings to an easy, selfencrypting file that can use either asymetric or symetric cryptography.
Add this line to your application's Gemfile:
gem 'nm_datafile'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nm_datafile
nmd = NmDatafile.new(:shippable_file)
nmd.sales = [1,2,3,4]
nmd.ready_for_shipment_batch = 1
nmd.save(path_to_file)
nmd_loaded = NmDatafile::Load(path_to_file)
nmd_loaded.sales #=> [1,2,3,4]
First define a file Schema. For instance, if you wanted a file type called 'shippable_file' and you wanted it to have many records of 'sales', 'line_items', etc, and you wanted your file to have a string of data named 'ready_for_shipment_batch', then you would define it like so.
$nm_datafile_schemas = {
schemas: {
:shippable_file => {
data_collections: [:sales, :line_items, :discounts, :addresses, :ubws, :encryption_pairs], # name the data that is input into the NMDatafile as an array
data_objects: [:ready_for_shipment_batch]
}
}
}
First define a schema for your NmDatafile. For instance, if you wanted a file called 'data_file' and you just wanted a "strings" attribute where you can store an array of encrypted strings, then you could set the below schema.
NmDatafile::SCHEMA = {
schemas: {
:data_file => {
data_collections: [:strings], # name the data that is input into the NMDatafile as an array
data_objects: [:file_owners_name]
}
}
}
That's actually the default schema, so you don't need to set it, it's located in lib/nm_datafile/schema.rb, fyi :)
Now that you've got a schema set up, you can start using your data and easily serialize data into an encrypted file format.
nmd = NmDatafile.new(:data_file)
nmd.strings #=> []
nmd.strings << "hi"
nmd.file_owners_name = "dsj"
nmd.save_to_string # This is a binary string for programmers, you can write it to a file
nmd.save_to_file('/tmp/file.zip') # this saves your strings to a file
Ok, you've done all that, but your data is visible as that it's a zip file. So to turn sneaky mode on, you'll want to
NmDatafile.Load('/tmp/secret_file')
Some cyphers are hardcoded in the tests... so if you make changes to the crypto algo, your tests will fail until you fix this...
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that nm_datafile 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.