본문 바로가기
파이썬

파이썬에서 hashlib를 사용하여 어떻게 해독합니까?

by º기록 2021. 1. 20.
반응형

암호화하는 방법을 알고 있습니다.

encrypted = hashlib.sha256('1234').hexdigest()

그러나 나는 이것을 해독하는 방법을 잘 모르겠습니까 ??

decrypted = decrypt(encrypted)

 

해결 방법

 



이상적인 암호화 해시 함수에는 네 가지 주요 속성이 있습니다.



from Crypto.Cipher import AES
import base64

cipher = AES.new(secret_key,AES.MODE_ECB) # never use ECB in strong systems obviously
encoded = base64.b64encode(cipher.encrypt(msg_text))
# ...
decoded = cipher.decrypt(baes64.b64decode(msg_text))


 

참조 페이지 https://stackoverflow.com/questions/15956952

 

 

반응형

댓글