Module: Nib::Crypt
- Defined in:
- lib/nib/crypt.rb,
lib/nib/crypt/key.rb,
lib/nib_crypt_plugin.rb,
lib/nib/crypt/version.rb,
lib/nib/crypt/initializer.rb
Defined Under Namespace
Classes: Initializer, Key
Constant Summary
collapse
- DEFAULT_KEY_NAME =
'secrets.aes'.freeze
- VERSION =
'0.1.3'.freeze
Class Method Summary
collapse
Class Method Details
.applies? ⇒ Boolean
3
4
5
|
# File 'lib/nib_crypt_plugin.rb', line 3
def self.applies?
true
end
|
.decrypt(input, output) ⇒ Object
19
20
21
|
# File 'lib/nib/crypt.rb', line 19
def decrypt(input, output)
exec(script(input, output, 'd'))
end
|
.encrypt(input, output) ⇒ Object
15
16
17
|
# File 'lib/nib/crypt.rb', line 15
def encrypt(input, output)
exec(script(input, output, 'e'))
end
|
.script(input, output, direction) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/nib/crypt.rb', line 23
def script(input, output, direction)
<<-"SCRIPT"
openssl enc \
-in #{input} \
-out #{output} \
-#{direction} \
-md md5 \
-aes256 \
-pass file:#{DEFAULT_KEY_NAME}
SCRIPT
end
|