<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=WebFund_2024F_Lecture_17</id>
	<title>WebFund 2024F Lecture 17 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=WebFund_2024F_Lecture_17"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=WebFund_2024F_Lecture_17&amp;action=history"/>
	<updated>2026-05-12T21:38:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=WebFund_2024F_Lecture_17&amp;diff=24844&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture for November 14, 2024 is now available: * [https://homeostasis.scs.carleton.ca/~soma/webfund-2024f/lectures/comp2406-2024f-lec17-20241114.m4v video] * [https://homeostasis.scs.carleton.ca/~soma/webfund-2024f/lectures/comp2406-2024f-lec17-20241114.cc.vtt auto-generated captions]  ==Notes==  &lt;pre&gt; Lecture 17 ----------  - Assignment 2 grades are mostly out     - if you submitted late or there was a formatting issue, still need to clean tha...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=WebFund_2024F_Lecture_17&amp;diff=24844&amp;oldid=prev"/>
		<updated>2024-11-14T20:03:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture for November 14, 2024 is now available: * [https://homeostasis.scs.carleton.ca/~soma/webfund-2024f/lectures/comp2406-2024f-lec17-20241114.m4v video] * [https://homeostasis.scs.carleton.ca/~soma/webfund-2024f/lectures/comp2406-2024f-lec17-20241114.cc.vtt auto-generated captions]  ==Notes==  &amp;lt;pre&amp;gt; Lecture 17 ----------  - Assignment 2 grades are mostly out     - if you submitted late or there was a formatting issue, still need to clean tha...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lecture for November 14, 2024 is now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/webfund-2024f/lectures/comp2406-2024f-lec17-20241114.m4v video]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/webfund-2024f/lectures/comp2406-2024f-lec17-20241114.cc.vtt auto-generated captions]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 17&lt;br /&gt;
----------&lt;br /&gt;
 - Assignment 2 grades are mostly out&lt;br /&gt;
    - if you submitted late or there was a formatting issue, still need to clean that up&lt;br /&gt;
 - T5 and T6 were due yesterday, still time for T7&lt;br /&gt;
 - Assignment 3 is due on Nov 20th&lt;br /&gt;
&lt;br /&gt;
Agenda for today&lt;br /&gt;
 - questions about A3&lt;br /&gt;
 - T8 (code in progress)&lt;br /&gt;
&lt;br /&gt;
Why do validation on the server?&lt;br /&gt;
 - we can&amp;#039;t trust that client code has run or run properly&lt;br /&gt;
    - server can receive arbitrary GETs and POSTs&lt;br /&gt;
 - so normally validation on the client is for the convenience of the user,&lt;br /&gt;
   real validation happens on the server&lt;br /&gt;
 - so A3Q5 means that the validation of the submission that is happening in the browser now should ALSO be done on the server&lt;br /&gt;
&lt;br /&gt;
Remember the point of education is to learn how to solve problems&lt;br /&gt;
 - I&amp;#039;m here to help you learn this&lt;br /&gt;
 - but also this is a basic skill that is beyond the scope of this class&lt;br /&gt;
&lt;br /&gt;
import &amp;amp; export&lt;br /&gt;
 - import - load an external javascript file&lt;br /&gt;
 - export - make functionality available when this file is imported by another&lt;br /&gt;
&lt;br /&gt;
import is like #include in C/C++, except there is no preprocessor&lt;br /&gt;
 - everything is just JavaScript code&lt;br /&gt;
&lt;br /&gt;
export is basically marking variables/functions as public, with the rest defaulting to private (only visible within the JS file, not outside of it)&lt;br /&gt;
&lt;br /&gt;
import/export are mechanisms for playing with JavaScript scope&lt;br /&gt;
 - combining the scopes of separate files which normally would be&lt;br /&gt;
   completely separate&lt;br /&gt;
&lt;br /&gt;
note that import/export has NOTHING to do with whether code is server or client side&lt;br /&gt;
 - same import/export works both on the client and server&lt;br /&gt;
 - however, you cannot import/export ACROSS this boundary&lt;br /&gt;
   - if code is server side, import/export code is also server side&lt;br /&gt;
   - if code is client side, import/export code is also client side&lt;br /&gt;
&lt;br /&gt;
Why shouldn&amp;#039;t web servers store passwords directly?&lt;br /&gt;
 - then if the server was compromised, user passwords could be stolen easily&lt;br /&gt;
 - need to store password information &amp;quot;securely&amp;quot;&lt;br /&gt;
 - solution: password hashes&lt;br /&gt;
&lt;br /&gt;
Why do we hash passwords?&lt;br /&gt;
 - so that if the authentication database is compromised, attackers&lt;br /&gt;
   will have to work to figure out what the passwords are&lt;br /&gt;
&lt;br /&gt;
Secure hashes are designed to be one way functions&lt;br /&gt;
 - If you have X, it is easy to calculate hash(X)&lt;br /&gt;
 - if you have hash(X), it is NOT EASY to get X&lt;br /&gt;
&lt;br /&gt;
In general, the only way to go from hash(X) =&amp;gt; X is to&lt;br /&gt;
 - guess G&lt;br /&gt;
 - calculate hash(G)&lt;br /&gt;
 - see if hash(G) = hash(X), if so, you&amp;#039;ve figured out&lt;br /&gt;
   X = G&lt;br /&gt;
&lt;br /&gt;
it can require LOTS of guessing, and hash functions can be made hard&lt;br /&gt;
to calculate so guessing is very expensive&lt;br /&gt;
&lt;br /&gt;
These attacks can be sped up because most people don&amp;#039;t pick random passwords. So instead, you can guess using a &amp;quot;dictionary&amp;quot; of likely passwords.&lt;br /&gt;
 - the dictionary can have classic variants like @ for a, so it can guess p@ssword&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note there are protocols for doing password authentication without sending the password in the clear to the server&lt;br /&gt;
 - not sure if it is used in practice in web applications,&lt;br /&gt;
   because of how they are structured&lt;br /&gt;
 - but they are used in other contexts where the server can trust client code&lt;br /&gt;
&lt;br /&gt;
IN GENERAL, as an application developer don&amp;#039;t worry about these security issues&lt;br /&gt;
 - instead, use standard solutions which implement best practices&lt;br /&gt;
 - if you do this on your own, you&amp;#039;ll mess it up, trust me&lt;br /&gt;
    - even security experts mess up, which is why they review each others&amp;#039; work&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>