Programming Theory:
Validation
6
Validation
Learning Objective:
Text
Learning outcome:
Text
2
iCan()
iCan.Explore()
I show an understanding of the topic by briefly describing my understanding
iCan.Enhance()
I show a good technical understanding and am able to show this through detailed description and evaluation of effectiveness.
iCan.Excel()
I can show an excellent technical understanding of the topic and can give factually correct examples and evidence.
3
Defensive Design Considerations
Make a list of where you commonly enter data.
When data is entered into a program it is important that it is valid in order for the program to operate correctly.
Sometimes users will deliberately enter incorrect or ‘spam’ data in an attempt to access a program or the program code.
4
Validation
5
Examples
A user is asked to enter a mobile phone number but only enters 9 digits.
A user has failed to fill out any of the the sign up form
6
Input Sanitisation
A method for validating data and stopping attacks is to clean up the data that is inputted so that it is ready for the application to use.
Some users may add additional data to try and access the program or provide clues on how to access the program.
Data sanitisation trims or strips strings, removing unwanted characters from strings
For example, Dave not dav%e, the % would be removed
This ensures that the input is correct and contains only the permitted characters, letters and symbols.
7
Input Sanitisation
8
Input Sanitisation (Answers)
9
Which code is better
10