What is the best algorithm (security and performance) for a storage server (WebDAV) programmed in php, to encrypt/decrypt different files (and sizes between 1Byte and 3GB)? AES256? And why?
And which mcrypt mode should I use? (ECB?)
What is the best algorithm (security and performance) for a storage server (WebDAV) programmed
Share
For security use CBC (it only differs on CPU performance, and CPU performance with AES in CBC mode is too fast even for the fastest drives).
Avoid ECB, it is really easy to break, especially with large datasets.
If CBC mode is not available, first compress and XOR with a very long password, before using ECB.
Do you need on-the-fly decryption at random seek points?
If yes, ignore the above, go with ECB, and write your file IO layer to decrypt from the start of each block.
Keep in mind this is pretty bad for security (at least try to change the key based on a secret algorithm of yours for each block).
AES modes are debated here.