module
AvramEncrypted::Cipher
Extended Modules
Defined in:
avram_encrypted/cipher.crInstance Method Summary
-
#decrypt(encrypted : String, keys : Hash(String, String) = AvramEncrypted.settings.keys) : String
Decrypts an encrypted string.
-
#decrypt(encrypted : String, type : Class, keys : Hash(String, String) = AvramEncrypted.settings.keys)
Decrypts an encrypted string and casts it to the desired type leveraging Crystal's
JSON::PullParser. -
#encrypt(value : String, keys : Hash(String, String) = AvramEncrypted.settings.keys, key_version : String = AvramEncrypted.settings.key_version) : String
Encrypts a string value.
-
#encrypt(value, **named_args) : String
Encrypts any value that responds to
.to_json. -
#recrypt(encrypted : String, keys : Hash(String, String) = AvramEncrypted.settings.keys, key_version : String = AvramEncrypted.settings.key_version) : String
Decrypts and re-encrypts an encrypted string it using the given or most recent key version.
Instance Method Detail
def decrypt(encrypted : String, keys : Hash(String, String) = AvramEncrypted.settings.keys) : String
#
Decrypts an encrypted string.
def decrypt(encrypted : String, type : Class, keys : Hash(String, String) = AvramEncrypted.settings.keys)
#
Decrypts an encrypted string and casts it to the desired type leveraging
Crystal's JSON::PullParser.
def encrypt(value : String, keys : Hash(String, String) = AvramEncrypted.settings.keys, key_version : String = AvramEncrypted.settings.key_version) : String
#
Encrypts a string value.
def recrypt(encrypted : String, keys : Hash(String, String) = AvramEncrypted.settings.keys, key_version : String = AvramEncrypted.settings.key_version) : String
#
Decrypts and re-encrypts an encrypted string it using the given or most recent key version.