Member Avatar for diliupgabadamudalige

Is there any way to encrypt/decrypt all image files and audio files with python storing them in a password protected file and then retrieving them again without slowing donw the decryption part?

Recommended Answers

All 3 Replies

What kind of encryption do you want to use?

Member Avatar for diliupgabadamudalige

I would like to package my program with py2exe for distribution. Py2exe is not very happy with some packages and modules. I tried to use pickle and shelve but these have a problem compiling with py2exe.
So i am experimenting with other ways to obsfucate the graphics, audio and the text files so the use can't tamper with them. I tried to lock them up in a zip file. Putting them into the zip file amnd password locking it works well but the retrival time is WAY TOO SLOW. So if there is any way to use only python and pygame to encrypt the above files so that they can be accessed only thru the program, and the retrival is very short that would be fine.

Member Avatar for diliupgabadamudalige

I downloaded and installed a new lib called czipfile which uses ctypes and the speed incerease in decryption of all files is incredible. An image that took 19.96 seconds now takes 0.02 seconds! If this compiles with py2exe then problem solved. Share this with others who might be interested.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.