Skip to content

A program that checks and removes unwanted input ensuring that data conforms to security-related requirements.

License

Notifications You must be signed in to change notification settings

JacYuan1/Input-Validation-and-Data-Sanitization-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Input Validation and Data Sanitization Project

Table of Contents

Introduction

The objective of this project is to use regular expressions to check and remove unwanted input ensuring that data conforms to security-related requirements.

Get Started

Here are some steps to get started:

  1. Download or copy the Code.py file
  2. Create a text or csv file anywhere on your pc and name it
  3. In the file open() function (Line 4) provide the location of that text file you've created in step 1
  4. Paste in samples (you can use the sample inputs provided here)
  5. Run the code!

Inputs Requirements

Here are all the valid input requirements:

  1. Student: 9 digits. acceptable formats: 000000000, 000 000 000
  2. Password: a-z, A-Z, 0-9, ascii printable special characters, minimum 12 characters
  3. Username: a-z, A-Z, 0-9, minimum 3 characters, maximum 20 characters
  4. Email: [email protected], username, domain and TLD will conform to the rules above for a “username” field. There will only be one TLD (i.e. no multiples like domain.co.uk)
  5. Previous: Confirm that this data field is identical to the previous line’s data field (excluding whitespace)
  6. Phone: A North American phone number. Possible formats: 1234567890, 123.456.7890, 123-456-7890, (123) 456-7890
  7. Postal: A Canadian postal code. Possible formats: A0A0A0, A0A 0A0
  8. Address: A string field containing a-z, A-Z, 0-9, periods and dashes.
  9. Binary: A single binary string, must contain only 1s and 0s with no breaks between digits
  10. Biography: A generic string field. Report “no” only if the field contains any html tags.

Example Inputs

Here are some example inputs:

student,999999999

password,abcd1234

username,user123

email,[email protected]

previous,[email protected]

phone,123-456-7890

postal,M86 72Z

address,123 street blvd.

binary,11110000

bio, hello world

student,9999 9999

student, 111111111

password,123456abcdef!!

username,stevedave

previous,stevedave

phone,((416-111-1234

postal,H1R3T7

bio,Hello<script>World</script>

Example Outputs

The output will be a simple “yes” or “no” string. Here is what the example output would look like (based on the provided input in the above section):

yes

no

yes

yes

no

yes

no

yes

yes

yes

no

yes

yes

yes

yes

no

yes

no

References

Reference Link

About

A program that checks and removes unwanted input ensuring that data conforms to security-related requirements.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages