Encrypt saved passwords
=======================

To encrypt passwords saved to an ini file, a user defined keyword must be provided.
This keyword is stored in the program code not as plain text to prevent retrieving
it from there. To encode the key, you can use the included program "EncPwd". It
uses the routine "EncodeString" from unit "Crypt". 

Example:
--------
User key: SampleKey
Calling "EncPwd SampleKey" returns "AA83CEA34295F249B384F15046A5D42D6625E80FCE189B4FEF"
Insert this as constant into your source code:
const
  PwdKey = 'AA83CEA34295F249B384F15046A5D42D6625E80FCE189B4FEF';
  
Note: These lines should replace the include statement in the main source:
{$I CopyPwdKey.inc }

Usage:
------
Read the password from ini file:
  Password:=DecryptPwdString(DecodeString(PwdKey),ReadString(Sekt,iniPwd,''),teAscii85);

Save the password to ini file:
  WriteString(Sekt,iniPwd,EncryptPwdString(DecodeString(PwdKey),Password,MaxUserPwdLength,teAscii85));

The unit "Crypt" must be part of the uses statement.

J. Rathlev
October 2020

