Validity and Security - Programming
Budget: $10 – $30 USD
This project discusses two issues (validity and security):
((Validity:))
Having a secure password is a very important practice when much of our information is stored online. So, it must be a function that validates a new password, following these rules:
• The password must be at least 8 characters long.
• The password must have at least one uppercase and one lowercase letter.
• The password must have at least one digit.
((Security:))
For a Credit Card Number Check, the last digit of a credit card number is the check digit, which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, it will be described for numbers with 8 digits instead of 16:
• Starting from the rightmost digit, form the sum of every other digit. For example, if the credit card number is 4358 9795, then you form the sum 5 + 7 + 8 + 3 = 23.
• Double each of the digits that were not included in the preceding step. Add all digits of the resulting numbers. For example, with the number given above, doubling the digits, starting with the next-to-last one, yields 18 18 10 8. Adding all digits in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27.
• Add the sums of the two preceding steps. If the last digit of the result is 0, the number is valid. In our case, 23 + 27 = 50, so the number is valid.
((Based on a previous explanation of Validity & Security, write a program to do these tasks:))
1- Call a function that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. This function should include a function that checks whether a password is valid based on the three previous rules.
2- Call a function that implements the algorithm of verifying actual credit card number. The function should ask the used to supply an 8-digit number and print out whether the number is valid or not. If it is not valid, the function should print the value of the check digit that would make it valid.
((Note: you should draw a flowchart for the program first then start coding in python.))
((Validity:))
Having a secure password is a very important practice when much of our information is stored online. So, it must be a function that validates a new password, following these rules:
• The password must be at least 8 characters long.
• The password must have at least one uppercase and one lowercase letter.
• The password must have at least one digit.
((Security:))
For a Credit Card Number Check, the last digit of a credit card number is the check digit, which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, it will be described for numbers with 8 digits instead of 16:
• Starting from the rightmost digit, form the sum of every other digit. For example, if the credit card number is 4358 9795, then you form the sum 5 + 7 + 8 + 3 = 23.
• Double each of the digits that were not included in the preceding step. Add all digits of the resulting numbers. For example, with the number given above, doubling the digits, starting with the next-to-last one, yields 18 18 10 8. Adding all digits in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27.
• Add the sums of the two preceding steps. If the last digit of the result is 0, the number is valid. In our case, 23 + 27 = 50, so the number is valid.
((Based on a previous explanation of Validity & Security, write a program to do these tasks:))
1- Call a function that asks for a password, then asks again to confirm it. If the passwords don’t match or the rules are not fulfilled, prompt again. This function should include a function that checks whether a password is valid based on the three previous rules.
2- Call a function that implements the algorithm of verifying actual credit card number. The function should ask the used to supply an 8-digit number and print out whether the number is valid or not. If it is not valid, the function should print the value of the check digit that would make it valid.
((Note: you should draw a flowchart for the program first then start coding in python.))