I have a project for school and it involves cryptography in Python. I need a way to export an AES key from the Pycryptodome module. I have looked at the docs but all I could find was a way to export a RSA key not an AES key. I have the generation, but I want the "user" to be able to save a key and then decrypt some data later. I obviously need a way to export the key but I cannot find a way to do so. Anyone able to help? I have found similar questions on Stackoverflow, but they are not about Python (looked at this one just in case even though its about Java).
Asked
Active
Viewed 54 times
0
-
I have heard of the `export_key` function but that seems to be for RSA. – Fighter178 Nov 10 '22 at 01:08
-
1You already have the key, you supplied it to the `AES.new()` method. – President James K. Polk Nov 10 '22 at 01:55
-
Wait, so the iv is the same? Because I would also have to store the iv right, as the same iv for a given key reduces entropy. – Fighter178 Nov 10 '22 at 03:23
-
1The IV is usually stored with the encrypted data not with the key (e.g. prepended to the encrypted data). – Robert Nov 10 '22 at 09:10