Elmug, my friend.
My application is portable. Runs at Usb Disks, offline and without a DBMS.
All data is stored in DBF files, that natively doesn't support any security.
The DBF files are encoded and stored at disk.
Before full loading, the application needs to decode all DBFs, but just in memory, for security reasons.
Finally, I just want know: how to store my cryptographic keys securely?
Someone knows?
TStrHolder is enough?
Hi ezlage,
if your datafiles are encrypted, and you work them in memory only, make sure that you save them only after they are encrypted again.
If you do happen to save them while un-encrypted, you overwrite them again, but encrypted.
Or if it merits copy them to external device like usb. Then erase-wipe the files that were stored unencrypted with utilities that replace the data with blanks. Then open the version saved to the external usb, to memory, encrypt it and save it while encrypted to wherever you need to.
If the data is not high value or really critical, overwriting with the encrypted file can be sufficient.
Now, to store passwords, in an encrypted file, the application would use an encoding algorithm, that you may find available, or invent you own.
The algorithm requests a password to do the encryption. The password is never built-in into the application, nor is ever a part of the algorithm.
The algorithm produces from the same plain text, different results for different passwords. Only with the same password, does the decryption give back the original plain text. The application creates a file with the resultant encryption. The decrypting algorithm is the opposite of the original encrypting algorithm, and decrypts the file, using momentarily a password supplied, which it clears from the variable that holds it immediately once used.
Note that decrypting algorithms have no way of knowing if the provided password is the correct one or not. They just do the decryption based on whatever password is supplied. The same is true for encrypting algorithms. They just encrypt the plain text using whatever password (the controlling parameter) is supplied. They work like a painter painting a wall. The paint color you give is the equivalent of the password.
You can also do encryption of anything, including COMPLETE DESK TOP databases using 7-Zip and use the option to use a password. This one works at the level of encrypting a single file or even folders and sub-folders. The benefit also, is that the size is much smaller than the original files, as far as storage, because it compresses data. If you are interested in mobility, maybe that can sort things out for you. Keep in kind that compressing data adds difficulty to eavesdroppers, so that on top of being encrypted is hard to beat.
I use that one often. If you are not familiar with it, you ought to download it and use it. It is free and works in Windows, Linux, and also in the Mac.
If any thing is not clear, I'd try to help out.