-2

i need an help to this challenge of programming.

"With this string: NzQwZjgxMTU2YzI3NjM1NA==

MD5 hash it and remove the last 16 characters of the hash. Iterate this process 50 times and submit the final truncated hash below."

What language can i use? Anyone can explain me the script to do?

1 Answers1

0
import hashlib

originalhash = 'MGE0ZjFmODRhMTQ0ZTJjYQ=='
print(originalhash)
previous = hashlib.md5(original.encode('ascii')).hexdigest()
print(previous)

for i in range(50):
        text = previous[0:-16]
        print(text)
        nexthash = hashlib.md5(previous.encode('ascii')).hexdigest()
        print(nexthash)
        previous = nexthash
Minal Chauhan
  • 6,025
  • 8
  • 21
  • 41
User
  • 1