Lainkes 0 Posted January 18 Hello, For now, I put my database connection info in an INI file. But due to security, I was wondering if I could encrypt that file so that users cannot read that information. Or is there another solution to protect my INI file? Thanks for your advice Greetings Lainkes Share this post Link to post
haentschman 92 Posted January 18 Hi... Quote I was wondering if I could encrypt that file so that users cannot read that information. ...encrypt not the file, only the information. 😉 XML like INI: <Password>xbWONK6X9KT/Pq1LFcV+4VRA8tePadM1yL+iVp3hA4rkgkbckH/EG00NYnuCkN22Zyg=</Password> There are several methods of encryption. DEC for example: https://github.com/MHumm/DelphiEncryptionCompendium 1 Share this post Link to post
FPiette 383 Posted January 18 Are you looking for strong cryptography against hackers or simple data scrambling so the casual user won't be able to see the data? Share this post Link to post
Lainkes 0 Posted January 18 Thanks, it makes more sence to encrypt only the data. It's for more advanced and curious internal users. So they cannot see the content. Share this post Link to post
FPiette 383 Posted January 18 (edited) 18 minutes ago, Lainkes said: It's for more advanced and curious internal users. So they cannot see the content. Then you can use very basic scrambling technique. For example base64 encoding. Additionally to base64, you can apply a simple XOR of each character. This won't resist to any serious hacker but none of "normal" user, even with good computer knowledge will not pass that kind of scrambling. Base64 routines are available in Delphi RTL and is many software. XOR encryption is so simple, you can write it yourself in a few minutes. Alternatively, you can use stronger cryptography (Lots of libraries for Delphi, one is there : https://github.com/MHumm/DelphiEncryptionCompendium) but then you need to hide the key somewhere (hardcoded in your program or store somewhere). You are almost back to the beginning. Edited January 18 by FPiette Share this post Link to post
Lainkes 0 Posted January 18 Thanks, I'll try to search more info about this topic. If someone has a small example, I would appreciate. I never used 3th party components. Share this post Link to post
Die Holländer 45 Posted January 18 You can consider not to use the INI but the Windows Credential Manager for storing information. Very easy to use (read/write) from Delphi. Share this post Link to post