SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have some really important javascripts, not because are any fancy coding, but becasue they handle certain, specific calculations. My client has developed various equations that no one else has in his industry, and he provides users a way to use them through JavaScript, is there any way I can secure these scripts? They are extreemly important and will be stolen fast if I cannot somehow make them inaccesable. If I can't totally prevent them from being taken, what's the BEST I can do?

    Thank You and God Bless
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  2. #2
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It sounds to me that this type of information should not be processed on the client but be pulled from a data base on the server. Let's wait a see what others say but this is what server side scripting is all about. It's not as easy as processing the information with a server side scripting langauge because this code can be displayed in the browser if there are problems with the server. The information must be processed with server side includes (SSI) and stored in a directory out side the web root directory. You could put the javascript in an SSI and call the include therefore the code will not display in the browser.

  3. #3
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's client side and JS is, then there is no way to prevent the user from learning the code. The best thing to do is write a PHP/Perl/Python/etc script which will handle all this server-side.

    It's not if, but when.

    Owen

  4. #4
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IMHO; You should never use client side scripting for anything other than form verification and graphic effects (like mouse overs). I have seen some people using long escape codes after converting the javascript to %asciscode. This stops any casual browsers, but anyone with a few minutes spare can just paste it into a hex program..
    Most servers have perl, a popular CGI program installed. If you are just learning, you may as well go with PHP for web work. I am just starting to really get into it.. it is pretty good

  5. #5
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to keep them secure then you will have to do the calculations on the server side as there is no way to stop people getting at the JavaScript if they want it. If the browser can read it then so can anyone else.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  6. #6
    imagine no limitations exbabylon's Avatar
    Join Date
    Dec 2000
    Location
    Idaho, USA
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my code below.

    Can I put it into a .js file as password protect it? Will my server allow it to be accessed if it is coming from my server? If not could you please help?

    I'm not very good in Perl or PHP (Just dove into them), would anyone consider helping me out? Mabey providing an example?

    Thank You again?
    <Edited by Karl on 12-16-2000 at 04:04 PM>
    Blamestorming: Sitting around in a group discussing why a deadline was missed or a project failed and who was responsible.

    Exbabylon- Professional Internet Services

  7. #7
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no way of making JS secure even by limiting what hosts can access it, if the browser gets sent the code then someone else can read it.

    I have edited your post to save you from your client and what you are trying to avoid as it makes it plainly clear what these calculations are for.

    I will write a script for you to do the job.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  8. #8
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good for us, we have a resposible advisor
    Good job Karl!
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  9. #9
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IMHO, if the code is already written in JavaScript the the easiest solutions would be to reset your pages as ASP and ask your host provider modify your IIS to JavaScript.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com


Bookmarks

Posting Permissions

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