Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Diffable encrypted files that you can safely commit into your repo.
Add this line to your application's Gemfile:
gem 'diffcrypt'
And then execute:
$ bundle install
Or install it globally (to use the CLI from any project):
$ gem install diffcrypt
There are a few ways to use the library, depending on how advanced your use case is.
The easiest way to get started is to use the CLI.
diffcrypt decrypt -k $(cat test/fixtures/aes-128-gcm.key) test/fixtures/example.yml.enc
diffcrypt encrypt -k $(cat test/fixtures/aes-128-gcm.key) test/fixtures/example.yml
A direct API is exposed so Diffcrypt::Encryptor
can be used in any ruby project.
NOTE: This API may change any time until v1.0
encryptor = Diffcrypt::Encryptor.new('99e1f86b9e61f24c56ff4108dd415091')
yaml = File.read('test/fixtures/example.yml')
encrypted = encryptor.encrypt(yaml)
File.write('tmp/example.yml.enc', encrypted)
encryptor = Diffcrypt::Encryptor.new('99e1f86b9e61f24c56ff4108dd415091')
yaml = File.read('test/fixtures/example.yml.enc')
config = YAML.safe_load(encryptor.decrypt(yaml))
Currently there is not native support for rails, but ActiveSupport can be monkeypatched to override
the built in encrypter. All existing rails credentials:edit
also work with this method.
# config/application.rb
module Rails
class Application
include Diffcrypt::Rails::ApplicationHelper
end
end
Sometimes you may want to rotate the cipher used on a file. You can do this programmatically using the ruby code above, or you can also chain the CLI commands like so:
diffcrypt decrypt -k $(cat test/fixtures/aes-128-gcm.key) test/fixtures/example.yml.enc > test/fixtures/example.128.yml \
&& diffcrypt encrypt --cipher aes-256-gcm -k $(cat test/fixtures/aes-256-gcm.key) test/fixtures/example.128.yml > test/fixtures/example.256.yml.enc && rm test/fixtures/example.128.yml
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/diffcrypt/diffcrypt-ruby.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that diffcrypt demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.