Class: Stenohttp2::Common::Protocol::Encrypter

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/stenohttp2/common/protocol.rb

Instance Method Summary collapse

Instance Method Details

#call(text) ⇒ Object



33
34
35
36
# File 'lib/stenohttp2/common/protocol.rb', line 33

def call(text)
  encrypted = cipher.update(text) + cipher.final
  CGI.escape(Base64.strict_encode64(encrypted))
end

#cipherObject



38
39
40
# File 'lib/stenohttp2/common/protocol.rb', line 38

def cipher
  @cipher ||= ::Stenohttp2::Common::CipherBuilder.encryptor
end