VB6: speeding up encryption/decryption
Posted on 2004-09-14
I have a VB6 application which uses several encrpyted text files to store data. Most of these files are very small: short record lengths and few records. However, the encryption routine that I am using is quite slow when reading/writing files with longer record lengths - one file has a record length of about 7000 bytes and decryption is very slow on that one even though there's only about a dozen records in the file for now. The overall file size is approx. 100K right now, but is anticipated to be even larger in the future.
I use Line Input to read these files into a UDT on a record-by-record basis, decrypting as I go, as opposed to decrypting the entire file all at once when the application opens. The reason for taking that approach is that decrypting to a "temporary" file is unacceptable (we can't have any UNencrypted data on disk at any time, even temporarily), and reading the entire decrypted file into an array would (I presume) consume way too much memory, which could then cause other problems.
My question is: is my assumption correct regarding loading the contents of an entire file in memory?
As you can probably tell, I am very new to working with files in this manner - what is the "standard" approach for working with encrypted data files in a VB6 app?