I am trying to read lines from a file which contains hashed data. The data was hash with the following code:
encoder = hashlib.sha224()
encoder.update(string)
file.write(en开发者_开发技巧coder.hexdigest())
how do I rehash the data?
As already said, you can't do that, and that's the actual idea behind hashing. I think what you are really looking for is encryption.
When the data is encrypted, nobody can read it. Only when you know how to decrypt it, you can read it again. There are many different ways of encryption, such as symmetric and asymmetric, just read about it, or supply more information about what you are really trying to do so we can tell you what encryption you should use.
精彩评论