Question

In: Computer Science

Generating secure password that you can remember, lab2pr0.py It’s not easy to come up with a...

Generating secure password that you can remember, lab2pr0.py It’s not easy
to come up with a secure password that one can actually remember. One of the
methods proposed is to take a line of text and take first letter of each word to form
a password. An extra step is substitute ”o” with 0, ”a” with ”@”, and ”l” with
1. For instance, using ”Cookies and Code, let’s meet on Tuesdays” would yield
”C@C,1m0T”. Write a program that asks the user to enter a phrase and outputs
the password that is generated using these rules.
You can assume that the words in the phrase will be separated by a single space or
a common punctuation sign such as ”.,?!;:” followed by a space.

use python

Solutions

Expert Solution

"""
Step-1) define method password_generator with input text from user as parameter to it.
Step-2)Split the words in the text based on white space using split(' ') method.
Step-3) Add first letter of each word to the password , if the first letter is 'o'->'0',
if it is 'a'->'@', if it is 'l'->'1'.
Since words in the text are seperated by a single space or
a common punctuation sign such as ”.,?!;:” followed by a space.
And we have already splitted the text based on 'white space' ,  therefore we just need to check the last letter of each word for punctuation sign and include it in the password.

'"""



def password_generator(text):
    password = ''
    temp_list = list(text.split())
    print(temp_list)
    for word in temp_list:
        if word[0] == 'o':
            password += '0'
        elif word[0] == 'l':
            password += '1'
        elif word[0] == 'a':
            password += '@'
        else:
            password += word[0]
        if word[-1] == ',' or word[-1] == ':' or word[-1] == '?' or word[-1] == '.'\
                or word[-1] == ';' or word[-1] == '!':
            password += word[-1]
    return password


if __name__ == '__main__':
    text = input('Enter text')

    print(password_generator(text))

If you have any doubts or want some modification in the code , just put the comment on the answer, i would be happy to help.


Related Solutions

It’s not easy to come up with a secure password that one can actually remember. One...
It’s not easy to come up with a secure password that one can actually remember. One of the methods proposed is to take a line of text and take first letter of each word to form a password. An extra step is substitute ”o” with 0, ”a” with ”@”, and ”l” with 1. For instance, using ”Come to the meadow on law street” would yield ”Cttm01s”. Write a program that asks the user to enter a phrase and outputs the...
You need to make up a password which contains 6 digits, which can be one of...
You need to make up a password which contains 6 digits, which can be one of 26 letters, 10 numbers (0-9) or 10 punctuation marks (!.,%$#*&=+). The first digit of the password must be a letter, and the last digit must also be a letter. There are no other restrictions. How many possible passwords are there?
can you come up with 10 examples of sentences with deductive reasoning,
can you come up with 10 examples of sentences with deductive reasoning,
You are working as a consultant and are assigned the task to set up a secure...
You are working as a consultant and are assigned the task to set up a secure communication channel between three premises in the company. The communication should be using symmetric encryption with new keys exchanged on a daily basis. All premises have individual X.509 certificates. Describe a solution that includes how to carry out the encryption, key exchange and certifying that there is no malicious man-in-the-middle attempt Kindly answer this question in the field of Applied Computer Security....
What was the hypothesis for e/m measurement experment you can come up with and did the...
What was the hypothesis for e/m measurement experment you can come up with and did the data support the hypothesis? Were there any observations which surprised you?
can you explain in details how did we come up with this answer and how to...
can you explain in details how did we come up with this answer and how to answer similar.. what is the economic concept behind it A serious drought has created a shortage of food across the country. In an attempt to maximize profits, one grocery store decided to auction off its limited supply of food. Which of the following scenarios is the MOST likely to occur in this situation? A. The willingness to pay for food would rise. B. The...
can you explain in details how did we come up with this answer and how to...
can you explain in details how did we come up with this answer and how to answer similar what is the economic concept behind this NO.152 A pharmaceutical company was recently awarded a 20 year patent for a new medicine it has developed. Which of the following results could be a consequence of this patent? (Select all that apply.) A. The high price of the medicine will result in insufficient demand. B. The pharmaceutical company will charge higher prices for...
can you explain in details how did we come up with this answer and how to...
can you explain in details how did we come up with this answer and how to answer similar NO.148 Two years ago, the purchasing manager at a company spent $25,000 on a new machine that would improve production efficiency at the company. The manufacturers of the machine release an updated model that costs $35,000 and that promises to further improve production efficiency. Under what conditions should the purchasing manager upgrade to the new model? A. If the savings from the...
PYTHON Exercise 3. Password locker. 1. You probably have accounts on many different websites. It’s a...
PYTHON Exercise 3. Password locker. 1. You probably have accounts on many different websites. It’s a bad habit to use the same password for each of them because if any of those sites has a security breach, the hackers will learn the password to all of your other accounts. Develop a simple password manager software on your computer where you write the account name (blog, facebook, instagram, etc) as an argument and the password is copied to the clipboard. Then...
1) Is myelin continuously being made? 2) can you come up with a good analogy for...
1) Is myelin continuously being made? 2) can you come up with a good analogy for the time course of the action potential?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT