I am writing a program that parses a file and tweets lines from it. I was able to write the program but I was curious if I should hash the Keys and Tokens that Twitter provides for added security? They tell you to protect the keys because they can be used to access your account. I was looking into using Python's hashlib library to do this, specifically this hashlib function.
hashlib.pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None)
To prevent brute-force attacks on passwords you should use a key derivation function and a salt so I want to know if doing this to the Keys and Tokens would make sense? I want to hash the Keys and Tokens one time, store them in a database file then be able to decrypt the hashes when I want to interact with Twitter. Is that possible and what method should I use to do this?