Show HN: Simple Image encrypt/decrypt using Python
github.com
github.com
And by "I think you should do" what I mean is "IO encryption already exists so you shouldn't need to do anything" (see https://developers.google.com/tink/encrypt-large-files-or-da... for one example). But if you really like making things yourself, it would be very easy to just not use PIL and numpy and read blocks from a stream into a small R/W buffer.
1) Encryption has nothing to do with images. If you encrypt arbitrary data from the file system then you don't need PIL or numpy.
2) Right now if your decompressed image doesn't fit in RAM, then your code dies horribly.
Using the same system interfaces and same encryption without the reliance on numpy or PIL, you could accomplish the same feat but safer, faster, and more universally en/decrypting raw data from a chunked IO stream instead of treating images as special somehow. It will work against all files and will never overflow available resources. PIL can't even decode all image formats.
Leave the image decoding part to the code that actually does something with images.
Is there anything particularly special about this project?