dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: URL Encryption

  1. #1
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    12

    URL Encryption

    long question.....

    i am trying to encrypt a url that is being passed to the clients browser that allows them to access a pdf on a server. We do not want the client to see the url because they can copy and paste it, by doing a view source, into their address and go directly to the pdf without even logging into our site, not good! I can encrypt the url however the client cannot decrypt it on their side. I could make them download an active x app so they could decrypt it but i am told we dont want to make our clients do that. the code is in a component that is being called by a asp page. I am doing a response.write inside the object to navigate the client to the pdf. make any sense? any suggestions.
    thanks.

  2. #2
    Join Date
    Jun 2002
    Location
    Lyman ME - USA | Oneonta NY - USA
    Posts
    399
    hmm i haven't worked with ASP at all but i had a friend do a huge shopping cart type of thing and i've done MANY online purchases...You can create a cookie on the clients computerset it up so that if the cookie is there the person can goto the document if not they cant. So they log in, cookie created, do stuff, logout, cookie dead, if they close the browser or goto a page off of your main domain, cookie dead....check up on cookie technology.

    hope this helps

    - nc
    "In a world without walls and barriers, what need is there for windows and gates!" - a mac ad
    "What was the best thing before sliced bread and when did sliced bread go out of existence?" - me
    "Software is like sex, it's better when it's free." - Linus Torvalds <- gotten from Andreas Masur


    Live Penguine! - Tux the linux mascot
    Vivez le penguine!, íViva en penguine!, Lang lebe der Pinguin!, Viva no penguine!, Viva sul penguine!

  3. #3
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    12
    thanks, unfortunately the powers that be disallow the use of cookies.

  4. #4
    Join Date
    Jul 2002
    Location
    India
    Posts
    505

    This may work...

    I am not aware of any way by which you could encrypt the URL and the decrypt it on the client, considering the circumstances you have mentioned. However, I have a solution which might be of intrest.

    My understanding is that one of the pages in your web application has a link to a PDF file. The page can be accessed only by authorised users. However, you fear that once people get hold of your PDF file's URL, they will not require to log in if they type in the URL of the PDF directly in the browser.

    Solution:
    The link should now point to an ASP file, say PDFview.asp. This asp will do the following.
    1) check if the session is valid i.e. if the person who has followed the link is authorised.
    2) next it checks if the PDF file mentioned in the querystring is available.
    3) reads the PDF file in binary format
    4) send the file to the client using Response.binarywrite. Actaully a binary stream is sent.

    Ensure that the contentype property of the Resposne object is set correctly so that the browser opens Acrobat reader instead of trying to open the file itself.

    I have not tried but I think <% Response.ContentType = "application/pdf" %>
    should do.

    Hope this helps.

    Satish

  5. #5
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    12
    thanks! i am working on this as we speak. will let you know how it turns out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)