module

PlaceOS::Encryption

Provides symmetric key encryption/decryption

Constants

Log = ::Log.for(self)

Class methods

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

Source
decrypt(string : String, id : String, level : Level, secret : String = SECRET) : String

Decrypt cipher text. Does not decrypt

  • previously decrypted
  • values with Level::None encryption
Source
decrypt_for(user : Model::User | Model::UserJWT, string : String, id : String, level : Level)
Source
encrypt(string : String, id : String, level : Level, secret : String = SECRET) : String

Encrypt clear text

Does not encrypt

  • previously encrypted
  • values with Level::NoEncryption encryption
Source
is_encrypted?(string : String)

Check if string has been encrypted

Source

Nested types