module PlaceOS::Encryption
Overview
Provides symmetric key encryption/decryption
Defined in:
placeos-models/utilities/encryption.crConstant Summary
-
Log =
::Log.for(self)
Class Method Summary
-
.check?(encrypted : String, test : String, id : String, level : Level) : Bool
Encrypt a test string with the encryption context in the cipher context and test for equality
-
.decrypt(string : String, id : String, level : Level, secret : String = SECRET) : String
Decrypt cipher text.
- .decrypt_for(user : Model::User | Model::UserJWT, string : String, id : String, level : Level)
-
.encrypt(string : String, id : String, level : Level, secret : String = SECRET) : String
Encrypt clear text
-
.is_encrypted?(string : String)
Check if string has been encrypted
Class Method Detail
Encrypt a test string with the encryption context in the cipher context and test for equality
def self.decrypt_for(user : Model::User | Model::UserJWT, string : String, id : String, level : Level)
#
Encrypt clear text
Does not encrypt
- previously encrypted
- values with
Level::NoEncryption
encryption