Sha256: 4e7cbcfce5bd844c3171074257ade6f82f09c12b6653b523ad17ba1eb83d5602
Contents?: true
Size: 822 Bytes
Versions: 18
Compression:
Stored size: 822 Bytes
Contents
# frozen_string_literal: true require_relative '../components/crypto' module NanoBot module Controllers module Security def self.decrypt(content) Components::Crypto.decrypt(content) end def self.encrypt(content, soft: false) Components::Crypto.encrypt(content, soft:) end def self.check password = ENV.fetch('NANO_BOTS_ENCRYPTION_PASSWORD', nil) password = 'UNSAFE' unless password && password != '' { encryption: Components::Crypto.encrypt('SAFE') != 'SAFE' && Components::Crypto.encrypt('SAFE') != Components::Crypto.encrypt('SAFE') && Components::Crypto.decrypt(Components::Crypto.encrypt('SAFE')) == 'SAFE', password: password != 'UNSAFE' } end end end end
Version data entries
18 entries across 18 versions & 1 rubygems