Created
April 16, 2017 03:02
-
-
Save picatz/1e6e986118185ec207309ec9bde6980a to your computer and use it in GitHub Desktop.
Violent Ruby: Unix Password Cracker Format Results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private | |
# @api private | |
# Format the results for the password crack'n. | |
# | |
# @param user [String] | |
# @param encrypted_pass [String] | |
# @param plaintext_pass [String] | |
# | |
# @return [Hash] | |
def format_result(user, encrypted_pass, plaintext_pass = false) | |
result = {} | |
if plaintext_pass | |
result[:cracked] = true | |
else | |
result[:cracked] = false | |
end | |
result[:username] = user | |
result[:encrypted_password] = encrypted_pass | |
result[:plaintext_password] = plaintext_pass if plaintext_pass | |
result | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment