How to encrypt and decrypt an image using Python? - The Security Buddy

PHOTO EMBED

Thu Nov 30 2023 19:45:38 GMT+0000 (Coordinated Universal Time)

Saved by @hagarmaher

def getKey(keysize):

    key = os.urandom(keysize)
    return key

def getIV(blocksize):

    iv = os.urandom(blocksize)
    return iv
content_copyCOPY

https://www.thesecuritybuddy.com/cryptography-and-python/how-to-encrypt-and-decrypt-an-image-using-python/