1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Rep Power

    *newbie* SHA1 hash computation

    I'm completely new to Python and can't wrap my head around this... I'm currently taking a class on this in post-grad school.

    Okay, so here's what I need to do.

    "Write a Python program that computes SHA1 hashes of a file, but truncates the digest to 8 bits (i.e., throw out all the digest, but the last 8 bits). Use your program to compute the 8-bit SHA1 hash of FILENAME.txt..."

    I'm totally lost and would appreciate any guidance...

    Thanks in advance.
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Mask the hash you compute with 255.

    MYHASH & 0xff
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo