handouts/ho01.tex
changeset 355 619073c37649
parent 336 3cb200fa6d6a
child 358 8787c16bc26e
equal deleted inserted replaced
354:8e5e84b14041 355:619073c37649
   181 signature-based method. The customer could now lose
   181 signature-based method. The customer could now lose
   182 significant amounts of money.
   182 significant amounts of money.
   183 
   183 
   184 \subsection*{Of Cookies and Salts}
   184 \subsection*{Of Cookies and Salts}
   185 
   185 
   186 Let us look at another example which will help with
   186 Let us look at another example which will help with understanding how
   187 understanding how passwords should be verified and stored.
   187 passwords should be verified and stored.  Imagine you need to develop
   188 Imagine you need to develop a web-application that has the
   188 a web-application that has the feature of recording how many times a
   189 feature of recording how many times a customer visits a page.
   189 customer visits a page.  For example in order to give a discount
   190 For example in order to give a discount whenever the customer
   190 whenever the customer has visited a webpage some $x$ number of times
   191 has visited a webpage some $x$ number of times (say $x$ equal
   191 (say $x$ equal $5$). There is one more constraint: we want to store
   192 $5$). There is one more constraint: we want to store the
   192 the information about the number of visits as a cookie on the
   193 information about the number of visits as a cookie on the
   193 browser. I think, for a number of years the webpage of the New York
   194 browser. I think, for a number of years the webpage of the New
   194 Times operated in this way: it allowed you to read ten articles per
   195 York Times operated in this way: it allowed you to read ten
   195 month for free; if you wanted to read more, you had to pay. My best
   196 articles per month for free; if you wanted to read more, you
   196 guess is that it used cookies for recording how many times their pages
   197 had to pay. My best guess is that it used cookies for
   197 was visited, because if I switched browsers I could easily circumvent
   198 recording how many times their pages was visited, because if I
   198 the restriction about ten articles.\footnote{Another online media that
   199 switched browsers I could easily circumvent the restriction
   199   works in this way is the Times Higher Education
   200 about ten articles.
   200   \url{http://www.timeshighereducation.co.uk}. It also uses cookies to
       
   201 restrict the number of free articles to five.}
   201 
   202 
   202 To implement our web-application it is good to look under the
   203 To implement our web-application it is good to look under the
   203 hood what happens when a webpage is displayed in a browser. A
   204 hood what happens when a webpage is displayed in a browser. A
   204 typical web-application works as follows: The browser sends a
   205 typical web-application works as follows: The browser sends a
   205 GET request for a particular page to a server. The server
   206 GET request for a particular page to a server. The server