开发者

Rehash in python

开发者 https://www.devze.com 2023-04-12 11:33 出处:网络
I am trying to read lines from a file which contains hashed data. The data was hash with the following code:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号