Module: Syndi::IRC::SASL::Mech::Plain

Defined in:
lib/syndi/irc/sasl/mech/plain.rb

Overview

Module which implements the SASL PLAIN mechanism.

Class Method Summary collapse

Class Method Details

.encrypt(username, password, provision) ⇒ Object

Create an SASL-encrypted hash.

Parameters:

  • username (String)

    The username.

  • password (String)

    The password associated with the username.

  • provision (String)

    The key provided by the server.

Author:

  • noxgirl



24
25
26
27
# File 'lib/syndi/irc/sasl/mech/plain.rb', line 24

def self.encrypt username, password, provision
  # Easy as this:
  Base64.encode64([username, username, password].join("\0")).gsub(/\n/, '')
end