SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
INPUT VALIDATION
WHY VALIDATE INPUT
 Validating user input is fundamental in
application development.
 It prevents users/systems from inadvertently
entering incorrect values or values that
should not be allowed into the application.
 Incorrect input can lead to user frustration or
serious security concerns
EXCEPTIONS
 An exception is a signal that a specific condition has
occurred that can’t be easily handled by normal
program flow.
 Ex. Trying to perform a calculation on a string
 Typically your application will error and crash,
however with exception handling we can catch the
error and safely exit the application, fix the issue, or
try again.
 Exceptions are preprogrammed conditional
statements for error catching, however you can
create your own error messages.
COMMON EXCEPTIONS
 ImportError – module not found
 ValueError – Inappropriate value
 KeyboardInterupt – When user terminates
application
 IOError – file cannot be opened
TRY-EXCEPT
 Code:
 try:
statement 1 to attempt
statement 2 to attempt
.
.
.
except: OPTIONAL EXCEPTION
USER CREATED EXCEPTION
TRY-CATCH EXAMPLE
 try:
val = int(input(“Enter a number”)
except: ValueError
 try:
val = int(input(“Enter a number”)
except: ValueError
print(“Not a valid number”)
 try:
val = int(input(“Enter a number”)
except: MyException
print(“Not a valid number”)
quit

More Related Content

PPTX
02. input validation module v5
PPT
SQLITE Android
PDF
Introduction to Software Security and Best Practices
PDF
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
PPT
Packages and interfaces
PPTX
Simple object access protocol(soap )
PPTX
Angularjs PPT
02. input validation module v5
SQLITE Android
Introduction to Software Security and Best Practices
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Packages and interfaces
Simple object access protocol(soap )
Angularjs PPT

What's hot (20)

PPTX
SQL INJECTION
PPTX
Command injection
PPTX
HTTP request and response
PPTX
Firewall in Network Security
PPTX
Introduction to ajax
PPTX
Method overloading
PPSX
ADO.NET
PPT
PPT
Introduction to Web Application Penetration Testing
PPTX
Introduction to php
PDF
Web Application Penetration Testing
PDF
Secure Code Review 101
PPTX
PPTX
PPT
PHP variables
PPT
Web development | Derin Dolen
PPTX
Basics of JAVA programming
PDF
4 pillars of OOPS CONCEPT
PPTX
Exception Handling in Java
PPT
Software security
SQL INJECTION
Command injection
HTTP request and response
Firewall in Network Security
Introduction to ajax
Method overloading
ADO.NET
Introduction to Web Application Penetration Testing
Introduction to php
Web Application Penetration Testing
Secure Code Review 101
PHP variables
Web development | Derin Dolen
Basics of JAVA programming
4 pillars of OOPS CONCEPT
Exception Handling in Java
Software security
Ad

Similar to Input Validation (20)

PDF
WhiteList Checker: An Eclipse Plugin to Improve Application Security
PDF
Python programming : Exceptions
PPT
Exception handling
ODP
PDF
lecs101.pdfgggggggggggggggggggddddddddddddb
PPTX
Python Exception handling using Try-Except-Finally
PDF
Exception-Handling Exception-HandlingFpptx.pdf
PPTX
Exceptional Handling in the python .pptx
PDF
Wondershare UniConverter Crack FREE Download 2025 version
PPTX
Mastering Errors and Exceptions in Python: A Comprehensive Guide
PDF
Exception handling in python
PDF
CONDITION AND ITERATIVE STATEMENTS CLASS XI
PPTX
1606125427-week8.pptx
PPTX
Python Unit II.pptx
PPS
Exception handling in c programming
PPTX
Exception handling.pptxnn h
PPTX
Software construction and development.pptx
PPT
Chapter 8 - Exceptions and Assertions Edit summary
PPT
Java căn bản - Chapter8
PPTX
Exception Handling in Python Programming.pptx
WhiteList Checker: An Eclipse Plugin to Improve Application Security
Python programming : Exceptions
Exception handling
lecs101.pdfgggggggggggggggggggddddddddddddb
Python Exception handling using Try-Except-Finally
Exception-Handling Exception-HandlingFpptx.pdf
Exceptional Handling in the python .pptx
Wondershare UniConverter Crack FREE Download 2025 version
Mastering Errors and Exceptions in Python: A Comprehensive Guide
Exception handling in python
CONDITION AND ITERATIVE STATEMENTS CLASS XI
1606125427-week8.pptx
Python Unit II.pptx
Exception handling in c programming
Exception handling.pptxnn h
Software construction and development.pptx
Chapter 8 - Exceptions and Assertions Edit summary
Java căn bản - Chapter8
Exception Handling in Python Programming.pptx
Ad

More from primeteacher32 (20)

PPT
Software Development Life Cycle
PPTX
Variable Scope
PPTX
Returning Data
PPTX
Intro to Functions
PPTX
Introduction to GUIs with guizero
PPTX
Function Parameters
PPTX
Nested Loops
PPT
Conditional Loops
PPTX
Introduction to Repetition Structures
PPTX
Windows File Systems
PPTX
Nesting Conditionals
PPTX
Conditionals
PPT
Intro to Python with GPIO
PPTX
Variables and Statements
PPTX
Variables and User Input
PPT
Intro to Python
PPTX
Raspberry Pi
PPT
Hardware vs. Software Presentations
PPTX
Block chain security
PPTX
Software Development Life Cycle
Variable Scope
Returning Data
Intro to Functions
Introduction to GUIs with guizero
Function Parameters
Nested Loops
Conditional Loops
Introduction to Repetition Structures
Windows File Systems
Nesting Conditionals
Conditionals
Intro to Python with GPIO
Variables and Statements
Variables and User Input
Intro to Python
Raspberry Pi
Hardware vs. Software Presentations
Block chain security

Recently uploaded (20)

PPTX
chapter 3_bem.pptxKLJLKJLKJLKJKJKLJKJKJKHJH
PPTX
_+✅+JANUARY+2025+MONTHLY+CA.pptx current affairs
PPTX
microtomy kkk. presenting to cryst in gl
PDF
Josh Gao Strength to Strength Book Summary
PPT
Gsisgdkddkvdgjsjdvdbdbdbdghjkhgcvvkkfcxxfg
PPT
APPROACH TO DEVELOPMENTALlllllllllllllllll
PPTX
Principles of Inheritance and variation class 12.pptx
PPTX
ESD MODULE-5hdbdhbdbdbdbbdbdbbdndbdbdbdbbdbd
PDF
シュアーイノベーション採用ピッチ資料|Company Introduction & Recruiting Deck
PPTX
1751884730-Visual Basic -Unitj CS B.pptx
DOCX
How to Become a Criminal Profiler or Behavioural Analyst.docx
PPTX
PE3-WEEK-3sdsadsadasdadadwadwdsdddddd.pptx
PPTX
Job-opportunities lecture about it skills
PDF
Understanding the Rhetorical Situation Presentation in Blue Orange Muted Il_2...
PPTX
1-4 Chaptedjkfhkshdkfjhalksjdhfkjshdljkfhrs.pptx
PPTX
normal_menstrual_cycle_,,physiology.PPTX
PPTX
The Stock at arrangement the stock and product.pptx
PPTX
OCCULAR MANIFESTATIONS IN LEPROSY.pptx bbb
PDF
Biography of Mohammad Anamul Haque Nayan
PDF
313302 DBMS UNIT 1 PPT for diploma Computer Eng Unit 2
chapter 3_bem.pptxKLJLKJLKJLKJKJKLJKJKJKHJH
_+✅+JANUARY+2025+MONTHLY+CA.pptx current affairs
microtomy kkk. presenting to cryst in gl
Josh Gao Strength to Strength Book Summary
Gsisgdkddkvdgjsjdvdbdbdbdghjkhgcvvkkfcxxfg
APPROACH TO DEVELOPMENTALlllllllllllllllll
Principles of Inheritance and variation class 12.pptx
ESD MODULE-5hdbdhbdbdbdbbdbdbbdndbdbdbdbbdbd
シュアーイノベーション採用ピッチ資料|Company Introduction & Recruiting Deck
1751884730-Visual Basic -Unitj CS B.pptx
How to Become a Criminal Profiler or Behavioural Analyst.docx
PE3-WEEK-3sdsadsadasdadadwadwdsdddddd.pptx
Job-opportunities lecture about it skills
Understanding the Rhetorical Situation Presentation in Blue Orange Muted Il_2...
1-4 Chaptedjkfhkshdkfjhalksjdhfkjshdljkfhrs.pptx
normal_menstrual_cycle_,,physiology.PPTX
The Stock at arrangement the stock and product.pptx
OCCULAR MANIFESTATIONS IN LEPROSY.pptx bbb
Biography of Mohammad Anamul Haque Nayan
313302 DBMS UNIT 1 PPT for diploma Computer Eng Unit 2

Input Validation

  • 2. WHY VALIDATE INPUT  Validating user input is fundamental in application development.  It prevents users/systems from inadvertently entering incorrect values or values that should not be allowed into the application.  Incorrect input can lead to user frustration or serious security concerns
  • 3. EXCEPTIONS  An exception is a signal that a specific condition has occurred that can’t be easily handled by normal program flow.  Ex. Trying to perform a calculation on a string  Typically your application will error and crash, however with exception handling we can catch the error and safely exit the application, fix the issue, or try again.  Exceptions are preprogrammed conditional statements for error catching, however you can create your own error messages.
  • 4. COMMON EXCEPTIONS  ImportError – module not found  ValueError – Inappropriate value  KeyboardInterupt – When user terminates application  IOError – file cannot be opened
  • 5. TRY-EXCEPT  Code:  try: statement 1 to attempt statement 2 to attempt . . . except: OPTIONAL EXCEPTION USER CREATED EXCEPTION
  • 6. TRY-CATCH EXAMPLE  try: val = int(input(“Enter a number”) except: ValueError  try: val = int(input(“Enter a number”) except: ValueError print(“Not a valid number”)  try: val = int(input(“Enter a number”) except: MyException print(“Not a valid number”) quit