none
How to encrypt the web page link

    Question

  • Hi all

    I have used this command in VB2005 windows application to start the iexplore.exe

    System.Diagnostics.Process.Start("iexplore.exe", www.easy.com/username=hi&password=gosh&x=1)

    The program execute successfully but the address link will
    state the username and password.

    Pls advise how can encrypt the web address so that to hid away the username and password.

    regards
    Tj

    Monday, October 6, 2008 6:42 AM

Answers

  • Tj Tay said:

    System.Diagnostics.Process.Start("iexplore.exe", www.easy.com/username=hi&password=gosh&x=1)
    The program execute successfully but the address link will state the username and password.
    Pls advise how can encrypt the web address so that to hid away the username and password.


    Hi Tj,

    Generally, we login website and sumbit credential information via <Form> element. Even if append argument at the end of URL, you can encrypt (e.g. MD5 arithmetic) these arguments beforehand, then pass them, finally decrypt them at server side.

    However,
    www.easy.com is not your program, I guess. It's out of your control.

    Thus, here is one suggestion:
    Use WebBrowser control to navigate to www.easy.com login page, then enter automatically username/password and click automatically Login button.

    Trackback this thread for code sample: How to login a website automatically via WebBrowser control?
    http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/99dfa27b-7d41-45bd-a035-df6a181a65b3/

    Public Class Form1  
     
        Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load  
            ' Part 1: Use WebBrowser control to load web page  
            WebBrowser1.Navigate("http://website/login.aspx")  
            System.Threading.Thread.Sleep(2000) ' Delay 2 seconds to render login page  
     
            ' Part 2: Automatically input username and password  
            '<input name="DL_AUTH_USERNAME" type="text" size=10>  UserName TextBox on page
            '<input name="DL_AUTH_PASSWORD" type="password">      Password TextBox on page  
            Dim theElementCollection As HtmlElementCollection  
     
            theElementCollection = Me.WebBrowser1.Document.GetElementsByTagName("input")  
            For Each curElement As HtmlElement In theElementCollection  
                Dim controlName As String = curElement.GetAttribute("name").ToString  
                If controlName = "DL_AUTH_USERNAME" Then 
                    curElement.SetAttribute("Value""Your username")  
                ElseIf controlName = "DL_AUTH_PASSWORD" Then 
                    curElement.SetAttribute("Value""Your password")  
                End If 
            Next 
     
            ' Part 3: Automatically clck that Login button  
            ' <input type="submit" value="Go" class="button">  Login Button on page 
            theElementCollection = WebBrowser1.Document.GetElementsByTagName("input")  
            For Each curElement As HtmlElement In theElementCollection  
                If curElement.GetAttribute("value").Equals("Go"Then 
                    curElement.InvokeMember("click")  
                End If 
            Next 
     
        End Sub 
     
    End Class 


    Best regards,
    Martin Xie

    Friday, October 10, 2008 8:57 AM

All replies

  • How does the web site decrypt an encrypted user name/password in the query string?

    Stephen J Whiteley
    Monday, October 6, 2008 9:30 AM
    Moderator
  • Tj Tay said:

    System.Diagnostics.Process.Start("iexplore.exe", www.easy.com/username=hi&password=gosh&x=1)
    The program execute successfully but the address link will state the username and password.
    Pls advise how can encrypt the web address so that to hid away the username and password.


    Hi Tj,

    Generally, we login website and sumbit credential information via <Form> element. Even if append argument at the end of URL, you can encrypt (e.g. MD5 arithmetic) these arguments beforehand, then pass them, finally decrypt them at server side.

    However,
    www.easy.com is not your program, I guess. It's out of your control.

    Thus, here is one suggestion:
    Use WebBrowser control to navigate to www.easy.com login page, then enter automatically username/password and click automatically Login button.

    Trackback this thread for code sample: How to login a website automatically via WebBrowser control?
    http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/99dfa27b-7d41-45bd-a035-df6a181a65b3/

    Public Class Form1  
     
        Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load  
            ' Part 1: Use WebBrowser control to load web page  
            WebBrowser1.Navigate("http://website/login.aspx")  
            System.Threading.Thread.Sleep(2000) ' Delay 2 seconds to render login page  
     
            ' Part 2: Automatically input username and password  
            '<input name="DL_AUTH_USERNAME" type="text" size=10>  UserName TextBox on page
            '<input name="DL_AUTH_PASSWORD" type="password">      Password TextBox on page  
            Dim theElementCollection As HtmlElementCollection  
     
            theElementCollection = Me.WebBrowser1.Document.GetElementsByTagName("input")  
            For Each curElement As HtmlElement In theElementCollection  
                Dim controlName As String = curElement.GetAttribute("name").ToString  
                If controlName = "DL_AUTH_USERNAME" Then 
                    curElement.SetAttribute("Value""Your username")  
                ElseIf controlName = "DL_AUTH_PASSWORD" Then 
                    curElement.SetAttribute("Value""Your password")  
                End If 
            Next 
     
            ' Part 3: Automatically clck that Login button  
            ' <input type="submit" value="Go" class="button">  Login Button on page 
            theElementCollection = WebBrowser1.Document.GetElementsByTagName("input")  
            For Each curElement As HtmlElement In theElementCollection  
                If curElement.GetAttribute("value").Equals("Go"Then 
                    curElement.InvokeMember("click")  
                End If 
            Next 
     
        End Sub 
     
    End Class 


    Best regards,
    Martin Xie

    Friday, October 10, 2008 8:57 AM