@@ -119,19 +119,6 @@ interface
119
119
// / regardless of locale.</remarks>
120
120
procedure SetDateTime (const Name : string; const Value : TDateTime);
121
121
122
- // / <summary>Gets a named encrypted string value from settings and
123
- // / unencrypts it.</summary>
124
- // / <param name="Name">string [in] Name of value.</param>
125
- // / <returns>string. The unencrypted string.</returns>
126
- function GetEncryptedString (const Name : string): string;
127
-
128
- // / <summary>Encrypts and records a named string value in settings.
129
- // / </summary>
130
- // / <param name="Name">string [in] Name of value.</param>
131
- // / <param name="Value">string [in] Value to be encrypted and recored.
132
- // / </param>
133
- procedure SetEncryptedString (const Name , Value : string);
134
-
135
122
// / <summary>Gets a list of related string values from the section.
136
123
// / </summary>
137
124
// / <param name="CountName">string [in] Name of an integer value that
@@ -234,7 +221,6 @@ implementation
234
221
IOUtils,
235
222
// Project
236
223
UAppInfo,
237
- UEncryptor,
238
224
UHexUtils,
239
225
UIOUtils,
240
226
UStrUtils;
@@ -465,21 +451,6 @@ TIniSettingsSection = class(TIniSettingsBase, ISettingsSection)
465
451
// / </remarks>
466
452
procedure SetDateTime (const Name : string; const Value : TDateTime);
467
453
468
- // / <summary>Gets a named encrypted string value from settings and
469
- // / unencrypts it.</summary>
470
- // / <param name="Name">string [in] Name of value.</param>
471
- // / <returns>string. The unencrypted string.</returns>
472
- // / <remarks>Method of ISettingsSection.</remarks>
473
- function GetEncryptedString (const Name : string): string;
474
-
475
- // / <summary>Encrypts and records a named string value in settings.
476
- // / </summary>
477
- // / <param name="Name">string [in] Name of value.</param>
478
- // / <param name="Value">string [in] Value to be encrypted and recored.
479
- // / </param>
480
- // / <remarks>Method of ISettingsSection.</remarks>
481
- procedure SetEncryptedString (const Name , Value : string);
482
-
483
454
// / <summary>Gets a list of related string values from the section.
484
455
// / </summary>
485
456
// / <param name="CountName">string [in] Name of an integer value that
@@ -608,17 +579,6 @@ destructor TIniSettingsSection.Destroy;
608
579
inherited ;
609
580
end ;
610
581
611
- function TIniSettingsSection.GetEncryptedString (const Name : string): string;
612
- var
613
- EncryptedBytes: TBytes; // encrypted value as array of bytes
614
- begin
615
- // NOTE:
616
- // See SetEncryptedString for details of how encrypted values are stored.
617
- if not TryHexToBytes(GetItemValue(Name ), EncryptedBytes) then
618
- Exit(' ' );
619
- Result := TEncoding.UTF8.GetString(TEncryptor.Decrypt(EncryptedBytes));
620
- end ;
621
-
622
582
function TIniSettingsSection.GetBoolean (const Name : string;
623
583
const Default: Boolean): Boolean;
624
584
var
@@ -746,19 +706,6 @@ procedure TIniSettingsSection.SetDateTime(const Name: string;
746
706
SetItemValue(Name , FormatDateTime(' yyyy"-"mm"-"dd" "hh":"nn":"ss' , Value ));
747
707
end ;
748
708
749
- procedure TIniSettingsSection.SetEncryptedString (const Name , Value : string);
750
- begin
751
- // NOTE:
752
- // Encrypted values are stored as follows:
753
- // 1: Unicode Value string is converted to an array of UTF-8 encoded bytes
754
- // 2: The UTF-8 byte array is encrypted into another array of bytes
755
- // 3: The encrypted byte array is converted to hexadecimal
756
- // 4: The hexadecimal character string is stored in storage
757
- SetItemValue(
758
- Name , BytesToHex(TEncryptor.Encrypt(TEncoding.UTF8.GetBytes(Value )))
759
- );
760
- end ;
761
-
762
709
procedure TIniSettingsSection.SetFloat (const Name : string; const Value : Double);
763
710
begin
764
711
SetItemValue(Name , FloatToStr(Value ));
0 commit comments