Hello, this is my first post on DaniWeb so I hope you'll go easy on me ,and my english.I'm working on a implementation of the AES algorithm in python;my app is supposed to encrypt the contents of files, and it does, yet it is kind of slow.I've optimized the code as good as I could because I am a beginner , but I would like to know if there is a way to reduce the amount of text , before I go through the encryption phase with it.I cannot use PyCrypto, nor OOP ( well I can only use OOP for the interface, silly requirements..), I used Galois multiplication tables for the MixColumns operation to further reduce the execution time, so if you have some ideea of how I could reduce the amount of text , please do tell.
Thank you for your help.
drak0
0
Newbie Poster
Recommended Answers
Jump to PostPerhaps you could compress the text first to reduce its size
import zlib text = open("file_to_be_encrypted.txt").read() data = zlib.compress(text) # normaly much shorter than text # ... encrypt data with your AES code # text can be retrieved with zlib.decompress(data)
This technique won't help if your data …
Jump to PostThank you, did that, I'm sorry for wasting your time, I should have said that is used zlib.One question about this , is it possible that pickling the text read from the file might increase it's size?
Yes I think it is possible, but not significantly. Pickle is not a …
All 6 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
drak0
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
drak0
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
drak0
0
Newbie Poster
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.