Reputation: 2378
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(encoder.hexdigest())
how do I rehash the data?
Upvotes: 0
Views: 4013
Reputation: 4002
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.
Upvotes: 1