python加密解密 sha256_SHA256加密和解密(Python2.7)相同的单词,但散列不同

我想写一个脚本,可以加密和解密的话。但我遇到了一个问题,无法理解。我用来加密的代码是:def encrypt():

print "Enter string for encryption: \n"

rec = raw_input()

enkr =hashlib.sha256(rec).hexdigest()

print enkr

我根据字典解密的代码是:def decrypt():

print "Enter hash for decryption: \n"

rec = raw_input()

print "Enter path of wordlist"

list = raw_input()

wordl=open(list,"r")

wordk = wordl.readlines()

for w in wordk:

w = hashlib.sha256(w).hexdigest()

if rec.lower() != w:

print "Not this " + w

elif rec.lower() ==w:

print "Found ! " + w

break

else:

print "Nothing found ! "

例如,假设我想加密单词“admin”。我得到这个散列8c6976e5b54141bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918

当我想解密的时候

fc8252c8dc55839967c58b9ad755a59b61b67c13227ddae4bd3f78a38b394f7

我的问题是,为什么我要用同一个函数得到两个不同的散列?致意,汗