Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Killed
#1
While running the program it simply gives the output "Killed" why is it and how can I solve this?

import hashlib

# Open the RAR3 file in binary mode
with open('hash.rar', 'rb') as f:
    # Read the contents of the file into memory
    file_contents = f.read()

    # Calculate the hash value of the file using the MD5 algorithm
    hash_value = hashlib.md5(file_contents).hexdigest()

# Print the hash value
print(hash_value)

I am thinking it is because the rar is password protected?
Reply
#2
How are you running the program? Where is the output "Killed" shown?

What operating system and version of Python are you using?

Just reading the file as bytes doesn't care that the RAR is password protected. It is still a bunch of bytes that can be copied, you just can't un-rar it.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020