Module: Encryptor
- Extended by:
- Encryptor
- Included in:
- Encryptor
- Defined in:
- lib/encryptor.rb,
lib/encryptor/string.rb,
lib/encryptor/version.rb
Overview
A simple wrapper for the standard OpenSSL library
Defined Under Namespace
Instance Method Summary collapse
-
#decrypt(*args, &block) ⇒ Object
Decrypts a
:value
with a specified:key
. -
#default_options ⇒ Object
The default options to use when calling the
encrypt
anddecrypt
methods. -
#encrypt(*args, &block) ⇒ Object
Encrypts a
:value
with a specified:key
.
Instance Method Details
#decrypt(*args, &block) ⇒ Object
43 44 45 |
# File 'lib/encryptor.rb', line 43 def decrypt(*args, &block) crypt :decrypt, *args, &block end |
#default_options ⇒ Object
The default options to use when calling the encrypt
and decrypt
methods
Defaults to { :algorithm => ‘aes-256-cbc’ }
Run ‘openssl list-cipher-commands’ in your terminal to view a list all cipher algorithms that are supported on your platform
17 18 19 |
# File 'lib/encryptor.rb', line 17 def @default_options ||= { :algorithm => 'aes-256-cbc' } end |
#encrypt(*args, &block) ⇒ Object
30 31 32 |
# File 'lib/encryptor.rb', line 30 def encrypt(*args, &block) crypt :encrypt, *args, &block end |