Post
Topic
Board Beginners & Help
Re: Be the first newbie to answer correct and get 1 merit
by
BitcoinIsABubble
on 23/03/2022, 09:10:54 UTC
Okay the only one I could think of that had a dataset available was the Million Song Dataset, and I tried encoding all of the song title names to SHA-1 via some sqlite3 queries and python, and output that out to a csv file. But I couldn't find the hash that I had found in the previous step. My guess is that the database is some different one altogether, I guess I'll give it a few more tries later.

Do not complicate the trivial !
Search engines are your friend  Tongue

P.S. probably did not find it due to uppercase letters or stuff like that. wrote the name of the song by hand and all lowercase


Ah its all lowercase. Then I would say the song is "Who Let The Dogs Out" by "Baha Men"

Method: Well I had already got the SHA-1 hash from the previous posts. Then I used the track_metadata from FMA Data for music analysis.

Then I wrote a short python code to get the SHA-1 hash name for each of the files and appended that with the track names. I wrote a pythonic script (instead of trying to find an online music search db) just because I wanted to check out some of its functions and also get familiar with some Capture The Flag contest method - this challenge was quite like some preliminary CTF contest
Here is the code:

Code:
import csv
import hashlib
import os.path

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_path = os.path.join(BASE_DIR, "songs.db")
file = open("C:\\hashes_tracks.csv", "w", encoding="utf-8")
with open("C:\\tracks.csv", "r", encoding="utf-8") as dataset:
    reader = csv.DictReader(dataset)
    for row in reader:
        name = row["title"].lower().strip()
        result = hashlib.sha1(name.encode())
        file.write(result.hexdigest() + name + '\n')

And then a simple search for the hash was enough to get the song name.
Proof that the hash matches
https://i.imgur.com/EfwkUN4.jpg

Oh wow, good job there!