I am getting error while encrypting the password using Python. I am explaining the error below.
Error:
Traceback (most recent call last):
File "password.py", line 60, in <module>
hashed_password = hashlib.sha512(sword + salt).hexdigest()
TypeError: cannot concatenate 'str' and 'list' objects
My code is given below.
import hashlib
value = "2Y7xk5vrs5DeCcSdinRVKQ=="
salt = value.split()
sword = "subhra1234"
hashed_password = hashlib.sha512(sword + salt).hexdigest()
print(hashed_password)
Here I need to use own salt value and trying to encrypting the password. Please help to resolve this error.
Like @MosesKoledoye said, you don't need to call split on the salt: