module AvramEncrypted::Cipher

Extended Modules

Defined in:

avram_encrypted/cipher.cr

Instance Method Summary

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 encrypt(value, **named_args) : String #

Encrypts any value that responds to .to_json.


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.