Creating Databases CSS example. One-way encryption. Passwords. Security issues. Work session.. Homework: Making unique posting on encryption, passwords,

Slides:



Advertisements
Similar presentations
Members Only & Login Modules Members Only works with the Login module to provide password protection to Web pages and files. Login Groups may be created.
Advertisements

COMP 321 Week 12. Overview Web Application Security  Authentication  Authorization  Confidentiality Cross-Site Scripting Lab 12-1 Introduction.
PHP Scripts HTML Forms Two-tier Software Architecture PHP Tools.
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP does not maintain state. State Information can be passed using: HTTP Headers.
Creating Databases applications for the Web Reprise. Basic HTML review, forms Preview: Server side vs client side Classwork: create HTML forms and check.
Logins  You will need PHP to test this code, all modern web hosting companies will provide this, Lehigh does not.  I've given you an account on des170.com:
Web-based Document Management System By Group 3 Xinyi Dong Matthew Downs Joshua Ferguson Sriram Gopinath Sayan Kole.
The World-Wide Web. Why we care? How much of your personal info was released to the Internet each time you view a Web page? How much of your personal.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
SYST Web Development 2 SYST Web Development 2 Course Overview and Introduction Client/Server Overview.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Session 11: Security with ASP.NET
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Cookies & Sessions.
Creating databases for web applications Walk before run? Songs with features example. Retrieve information from database. Recordsets. Arrays. Loops. Homework:
Class 8Intro to Databases Authentication and Security Note: What we discuss in class today covers moderate to low security. Before you involve yourself.
CHAPTER 12 COOKIES AND SESSIONS. INTRO HTTP is a stateless technology Each page rendered by a browser is unrelated to other pages – even if they are from.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
HTML II. Factors to consider in designing a website. Organizing your files. HTML Tables. Unordered Lists. Ordered Lists. HTML Forms. Learning Objectives.
Creating a Web Site to Gather Data and Conduct Research.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
Feedback #2 (under assignments) Lecture Code:
School of Computing and Information Systems CS 371 Web Application Programming PHP – Forms, Cookies, Sessions and Database.
Creating databases for web applications Database datatypes. Creating database Homework: Create tables in database. Add records to database.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Week seven CIT 354 Internet II. 2 Objectives Database_Driven User Authentication Using Cookies Session Basics Summary Homework and Project 2.
Lecture 8 – Cookies & Sessions SFDV3011 – Advanced Web Development 1.
NMD202 Web Scripting Week3. What we will cover today Includes Exercises PHP Forms Exercises Server side validation Exercises.
CS 174: Web Programming September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Chapter 6: Authentications. Training Course, CS, NCTU 2 Overview  Getting Username and Password  Verifying Username and Password  Keeping The Verification.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Introduction to Client-Side Web Development Introduction to Client-Side programming using JavaScript JavaScript; application examples 10 th February 2005.
Creating Databases Local storage. join & split Classwork: show 1 table application. Share designs for oscars application. Adaptive select. Homework: [Catch.
Creating databases for web applications Library. New example: student database. Homework: Complete class example. Catch up on source postings. Do creation.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP Headers Client IP Address HTTP User Login FAT URLs Cookies.
DataFlow Diagram – Level 0
PHP Secure Communications Web Technologies Computing Science Thompson Rivers University.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Chapter 12: How Private are Web Interactions?. Why we care? How much of your personal info was released to the Internet each time you view a Web page?
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
Creating Databases One-way encryption. Passwords. Security issues. Data normalization. Integrity and Robustness. Homework: Finalize teams & projects. Making.
Getting Started. Package Overview (GradeQuick)‏ Web-based grade book –Access Anywhere –Always Current Paper grade book “look and feel” Flexible grading.
© Copyright 2009 SSLPost 01. © Copyright 2009 SSLPost 02 a recipient is sent an encrypted that contains data specific to that recipient the data.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Add in foreign text failed I was trying to add foreign text (Myanmmar) to LIVE SCORE text but it is showing me ???????????????? The text I was adding
ASSIGNMENT 2 Salim Malakouti. Ticketing Website  User submits tickets  Admins answer tickets or take appropriate actions.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
ITM © Port,Kazman 1 ITM 352 Cookies. ITM © Port,Kazman 2 Problem… r How do you identify a particular user when they visit your site (or any.
1 PHP HTTP After this lecture, you should be able to know: How to create and process web forms with HTML and PHP. How to create and process web forms with.
Higher Computing Science Coding the Web: HTML, JavaScript, PHP and MySQL.
COEN 350: Network Security E-Commerce Issues. Table of Content HTTP Authentication Cookies.
Secure Transactions Chapter 17. The user's machine No control over security of user's machine –Might be in very insecure: library, school, &c. Users disable.
COOKIES AND SESSIONS.
LOGIN FORMS.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
Intro to WordPress (Using XAMPP)
Tonga Institute of Higher Education IT 141: Information Systems
Creating Databases Local storage. join & split
Creating Databases CSS example. One-way encryption. Passwords.
ITM 352 Cookies.
Cookies BIS1523 – Lecture 23.
Web Systems Development (CSC-215)
PHP: Security issues FdSc Module 109 Server side scripting and
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

Creating Databases CSS example. One-way encryption. Passwords. Security issues. Work session.. Homework: Making unique posting on encryption, passwords, security, Clinton . Keep working on projects.

Stories problem A pesky user (namely me) uploaded a story referencing a big image. Challenge: without asking anything more from the user and also acting retroactively, create CSS to limit size of image.

@charset "utf-8"; /* CSS Document */ header {display:block; font-family: Garamond, serif; font-size: 30px; font-style:bold; } article {display:block; width: 80%; padding: 3px; font-family: Garamond, serif; font-size: 16px; border: 1px solid black; border-radius: 10px; } article > img {border-radius: 15px; height: 40%; width: auto; border-style: solid; border-color: blue; }

News stories? Big Data Behavioral marketing Privacy Net Neutrality ???

Passwords How can your security with respect to passwords be compromised?

Password advice Do what they force us (the faculty) to do at Purchase –change passwords often Don't put on paper that you leave around. Use different passwords. Monitor your bank, credit card, etc. ???

Password protection Over-the-shoulder: –use password type for input fields. –Use post and not get [use https connection. Needs cooperation of server.] Use one-way hash algorithm ???

Secure Hash Algorithm-256 Takes input and produces a digest (256 bits long) One-way: very difficult to decrypt it. Can be done on the server or on the client. –I will demonstrate on the client. Test is done digest vs digest. Protects against some inside jobs: someone may know the digest, but won't know the plain text to produce the digest.

Start of password system meyer/research/register.htmlhttp://socialsoftware.purchase.edu/jeanine. meyer/research/register.html –probably never have this as part of a production application.

outline of register.html Register function encode() { …. }..

register.html User name Password Confirm password

function encode() { var pw1 = document.f.pw.value; if ((document.f.un.value.length<1) ||(pw1.length<1)) { alert("Need to enter User Name and Password. Please try again."); return false; } else if (pw1 == document.f.cpw.value) { document.f.pw.value = SHA256(pw1); document.f.cpw.value = ""; alert("document.f.pw.value now is "+document.f.pw.value); return true; } else { alert("passwords do not match. Please try again."); return false; }

Note After submitting the form, the encode function does [some] client side validation. It returns true if appropriate to continue to the action script It returns false if appropriate to return the form for the user to try again. Notice that the second password field is cleared if the two are the same Notice that the first password field is altered: document.f.pw.value = SHA256(pw1); So…only the encrypted (aka digest) is sent to server.

completereg.php Add song to database <?php require("opendbo.php"); $tname = "finders"; $finder = addslashes($_POST["un"]); $epw = $_POST["pw"]; $query = "INSERT INTO $tname values ('0','$finder','$epw')"; $result = mysqli_query($link,$query); if ($result) { print("The finder was successfully added. \n"); } else { print ("The finder was NOT successfully added. \n");} ?>

Remember computer systems are made up of –hardware –software –[networks] –people –procedures

Registration system Assign people passwords –Admin. does the registration just shown Provide way for users to change passwords Tradeoff: –randomly generated versus –one the player can remember

Change password scripts changepassword.html –show out of order, body first completechangepassword.php

User name Current password Password Confirm password Your browser does not recognize canvas

start of changepassword.html Change password

function encode() { var ctx= document.getElementById("canvas").getContext("2d"); ctx.clearRect(0,0,600,600); var pw1 = document.f.oldpw.value; var npw = document.f.newpw.value; if ((document.f.un.value.length<1) ||(pw1.length<1)) { alert("Need to enter User Name and Password. Please try again."); return false; } else if (npw == document.f.cpw.value) { document.f.oldpw.value = SHA256(pw1); document.f.newpw.value = SHA256(npw); document.f.cpw.value = document.f.newpw.value; return true; } else { drawroundedarrowbox(ctx,10,30,40,300,80,"Passwords do not match.",30,"black","pink"); return false; } }

Note Allows new to be the same as current . Many places do NOT allow this and some even go back in time.

completechangepw.php Complete change finder password <?php require("opendbo.php"); $tname = "finders"; $finder = $_POST["un"]; $epw1 = $_POST["oldpw"]; $epw2 = $_POST["newpw"]; $query = "UPDATE $tname SET epw = '$epw2' WHERE username = '$finder' AND epw = '$epw1'"; $result = mysqli_query($link, $query); if ($result) { print("The password was changed. \n"); } else { print ("The password was NOT successfully changed. \n"); } ?>

addsite scripts meyer/research/addsite.htmlhttp://socialsoftware.purchase.edu/jeanine. meyer/research/addsite.html addsite.html –show body first addsite.php –tries to make addition and –presents new form for adding another site or going to one of the display scripts goes into and out of php

Site: Date: Site description: URL: Category: Username: Password: Save on this computer next time you invoke addsite?

addsite.html retrieves information from local Storage does the encoding: client side then server side handling Start of the file: Add website info, login

retrieveinfo function function retrieveinfo() { var savedun; var savedpw; try { savedun = localStorage.getItem("researchun"); savedpw = localStorage.getItem("researchpw"); if (savedun) { document.f.un.value = savedun; document.f.pw.value = savedpw; document.getElementById("greeting").innerHTML="Welcome Back."; document.f.saveok.value = "Yes"; } } catch(e) {} }

encode function function encode() { var pw1 = document.f.pw.value; if (document.f.saveok.value!="No") { try { localStorage.setItem("researchun",document.f.un.value); localStorage.setItem("researchpw",pw1); } catch(e) { alert("error on local storage "+e); } } else { //no saving, remove anything saved try { localStorage.removeItem("researchun"); localStorage.removeItem("researchpw"); } catch(e) { //alert("error on local storage "+e); } } if ((document.f.un.value.length<1) ||(pw1.length<1)) { alert("Need to enter User Name and Password. Please try again."); return false; } else { document.f.pw.value = SHA256(pw1); return true; } }

start of addsite.php Complete adding site to research table <?php require("opendbo.php"); $tname = "sitesfinders"; $stitle=addslashes($_POST["stitle"]); $sdate=$_POST["sdate"]; $sdesc=addslashes($_POST["sdesc"]); $surl=$_POST["surl"]; $scat = addslashes($_POST["scat"]); $un =$_POST['un']; $epw = $_POST['pw'];

$query = "SELECT * FROM finders WHERE username='$un' AND epw='$epw'"; $result = mysqli_query($link, $query); if ($row=mysqli_fetch_array($result)) { $fid = $row['finderid']; $query = "INSERT INTO $tname values ('0','$stitle','$sdate','$surl','$sdesc','$scat','$fid')"; $result = mysqli_query($link, $query); if ($result) { print("The site was successfully added. \n"); ?>

Add [another] web site? Site: Date: Site description: URL: Category:

<?php print ("Username: <input name='un' type=' ' value='"); print ($un."' />"); print ("Password: "); ?>

Show all websites or Show sites for a category <?php } else { print ("The site was NOT successfully added. \n"); } else { print ("Problem with username and/or password and/or data."); } ?>

Where should (persistent) data go? localStorage (cookie) on client computer Database (s) Flat file on server –File with its own encoding XML file on server Decisions based on more than technical factors….

Fields of table Set up using php (or phpMyAdmin) in a certain order, set names, data types Two variations for INSERT –“INSERT INTO questions VALUES (‘0’,’$qtext’,’$atext’,$val)” Must use order used in creation step –“INSERT into questions (text,value,answer) VALUES (‘$qtext’, $val,’$atext’)”

Number of records After any SELECT, can query the number of records. $query = "SELECT * FROM tablename"; $result = mysqli_query($link,$query); $num_rows = mysqli_num_rows($result); echo $num_rows;

Homework Make unique posting on security, password, encryption, OR current kerfuffle involving Hillary Clinton’s use of private (vs.gov) . –READ the reference and comment on it!!! Work on enhancement projects.