lib/pt_search.rb
#Attempts to determine if password is base64 encoded or not.
#Uses this recipe: http://stackoverflow.com/questions/8571501/how-to-check-whether-the-string-is-base64-encoded-or-not
Attempts to determine if password is base64 encoded or not.
Attempts to determine if password is base64 encoded or not .
def password_encoded?(password)
        reg_ex_test = "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$"
        if password =~ /#{reg_ex_test}/ then
            return true
        else
            return false
        end
    end
def password_encoded? ( password ) reg_ex_test = "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$" if password =~ / #{ reg_ex_test } / then return true else return false end end
Attempts to determine if password is base64 encoded or not.
Attempts to determine if password is base64 encoded or not .
password
<not_specific>