What is the difference between making python open and reading a file, passing the reading result between blades?
When I open a file that contains only the word test and I pass this result from the read by a hash algorithm the result is:
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
Note: Result is not as expected
Now if I pass as a parameter inside the code (it is not user input) to the hash algorithm the string "test"
b123e9e19d217169b981a61188920f9d28638709a5132201684d792b9264271b7f09157ed4321b1c097f7a4abecfc0977d40a7ee599c845883bd1074ca23c4af
Note: This is the expected result; I'm using .encode ('utf-8') in the command
Command:
hashlib.sha512(hash_target).hexdigest()
hash_target is the string that goes through the hash algorithm, which in the example above would be the test
To read the file I used the command:
archive = open(file, 'r')