Namespace

Class Index [+]

Quicksearch

Samba::Encrypt

Public Instance Methods

lm_hash(password, encoding=nil) click to toggle source

(Not documented)

# File lib/samba/encrypt.rb, line 6
    def lm_hash(password, encoding=nil)
      dos_password = Private.convert_encoding("ISO-8859-1",
                                              encoding || "UTF-8",
                                              password.upcase)
      if dos_password.size > 14
        warn("password is truncated to 14 characters")
        dos_password = dos_password[0, 14]
      end
      Private.encrypt_14characters(dos_password).unpack("C*").collect do |char|
        "%02X" % char
      end.join
    end
ntlm_hash(password, encoding=nil) click to toggle source

(Not documented)

# File lib/samba/encrypt.rb, line 19
    def ntlm_hash(password, encoding=nil)
      ucs2_password = Private.convert_encoding("UCS-2",
                                               encoding || "UTF-8",
                                               password)
      if ucs2_password.size > 256
        raise ArgumentError.new("must be <= 256 characters in UCS-2")
      end
      hex = OpenSSL::Digest::MD4.new(ucs2_password).hexdigest.upcase
      hex
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.