Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.03.18;
Скачать: [xml.tar.bz2];

Вниз

Как можно шифровать текст в Memo ListBox RichEdit перед сохранением на диск. А при чтении расшифровывать. Чтоб никто не читал его. Желательно чтобы было быстро и просто.   Найти похожие ветки 

 
дикое Кенгуру   (2002-02-28 05:01) [14]

Poirot

xor можно делать не только одним символом.
из Rx :

function XorEncode(const Key, Source: string): string;
var
I: Integer;
C: Byte;
begin
Result := "";
for I := 1 to Length(Source) do begin
if Length(Key) > 0 then
C := Byte(Key[1 + ((I - 1) mod Length(Key))]) xor Byte(Source[I])
else
C := Byte(Source[I]);
Result := Result + AnsiLowerCase(IntToHex(C, 2));
end;
end;

function XorDecode(const Key, Source: string): string;
var
I: Integer;
C: Char;
begin
Result := "";
for I := 0 to Length(Source) div 2 - 1 do begin
C := Chr(StrToIntDef("$" + Copy(Source, (I * 2) + 1, 2), Ord(" ")));
if Length(Key) > 0 then
C := Chr(Byte(Key[1 + (I mod Length(Key))]) xor Byte(C));
Result := Result + C;
end;
end;



Страницы: 1 2 вся ветка

Форум: "Основная";
Текущий архив: 2002.03.18;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.004 c
1-57369
Priz_Datiy
2002-03-04 11:43
2002.03.18
Проблеммы с StrToInt


6-57488
Pantero
2001-12-29 22:53
2002.03.18
Послать мыла наименшими ресурсами в Дельфи


4-57551
gluka
2002-01-16 06:22
2002.03.18
LogonUser,.......CreateProcessAsUser ??? Est problems...


7-57527
VictorM
2001-12-11 16:28
2002.03.18
звук


3-57311
draculenok
2002-02-19 12:51
2002.03.18
COmbobox .....





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский