I have a text file of size 2.5 GB which contains hash values of some standard known files. My task is to find the hash of all files on my file system and compare it with the hashes stored in the text file. If a match is found I need to print Known on the screen and if no match is found then I need to print unknown on  the screen.
Thus the approach for the task is quite simple but the main issue is that the files involved in the process are very huge.
Can somebody suggest how to accomplish this task in an optimized way.
Should I import the text file containing hashes to a database. If yes, then please provide some link which could possibly help me accomplish it.
Secondly what algorithm can I use for searching to speed up the process?
My preferred language is Python.
Search on StackOverflow for code to recursively list full file names in Python
Search on StackOverflow for code to return the hash checksum of a file

Then list files using an iterator function. Inside the loop:

Get the hash checksum of the current file in the loop
Iterate through every hash. Inside the loop:

Compare with the current file's checksum


Algorithms? Don't worry about it. If you iterate through each line of the file, it will be fine. Just don't load it all at once, and don't load it into a data structure such as a list or dictionary because you might run out of memory.
Perform searching on very large file programatically in Python