During a penetration test, a security consultant needs to automate the hash calculation of each password in a text file and store the results in memory. Which of the following Python snippets should the tester use to accomplish this task?
None of these would really work, as the hashlib.sh256 function expects a byte-like object in the input rather a string. But going off of the perceived intentions of the snippets,
A. is the only one that aims to hash each individual line by defining the variable 'password' that's within the 'lines' variable
B. calls for hashing 'line' which isn't defined anywhere else in the code
C. and D. seem to hash the entire 'lines' variable, which isn't what the tester wants
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.PT0-002 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
BlackSkullz
5 months, 3 weeks ago