A challenge to iterate truncated md5 hash

379 Views Asked by At

i need an help to this challenge of programming.

With this string: OTE2MDM5NjJmZDdkYTQ0OA==

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?

i saw someone post the answer to this before but they didn't specify the language it was in.

1

There are 1 best solutions below

0
On

Here is a quick made solution in bash:

# cat string.sh
#!/bin/bash

str="OTE2MDM5NjJmZDdkYTQ0OA=="

for i in {1..50}
do
  str=$(echo $str | md5sum | cut -c1-16)
done

echo $str
    
# ./string.sh
076f9461e86839f6