Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ end

## Converting between ciphers

Sometimes you may want to rotate the cipher used on a file. You cab do this rogramtically using the ruby code above, or you can also chain the CLI commands like so:
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:

```shell
diffcrypt decrypt -k $(cat test/fixtures/aes-128-gcm.key) test/fixtures/example.yml.enc > test/fixtures/example.128.yml \
Expand Down
4 changes: 2 additions & 2 deletions lib/diffcrypt/rails/encrypted_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def encrypt(contents, original_encrypted_contents = nil)
# @return [String]
def decrypt(contents)
if contents.index('---').nil?
@active_support_encryptor.decrypt_and_verify contents
active_support_encryptor.decrypt_and_verify contents
else
encryptor.decrypt contents
end
Expand All @@ -108,7 +108,7 @@ def decrypt(contents)
# Rails applications with an existing credentials file, the inbuilt active support encryptor should be used
# @return [ActiveSupport::MessageEncryptor]
def active_support_encryptor
@active_support_encryptor = ActiveSupport::MessageEncryptor.new(
@active_support_encryptor ||= ActiveSupport::MessageEncryptor.new(
[key].pack('H*'),
cipher: @diffcrypt_file.cipher,
)
Expand Down