I am trying to Implement AES encryption in python.
I am referring a java code sample in order to accomplish this.
In Java, the 256 bit secret (using the given key) is generated using
Key secretKey = new SecretKeySpec(Base64.decodeBase64(GIVEN_KEY), "AES");
I am trying to do the same in python using the following snippet
secret = hashlib.sha256(GIVEN_KEY.encode()).digest()
But the string encoded with python implementation is not being able to get decrypted. Is the above snippets similar, or is there anything I am missing?