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

Вниз

СПАСИТЕ ОТ ОТЧИСЛЕНИЯ НУЖНА САМАЯ ПРОСТАЯ ПРОГА для ШИФРОВАНИЯ и ДЕШИФРОВАНИЯ СТРОКИ ТЕКСТА   Найти похожие ветки 

 
AlexeyV   (2001-12-21 05:07) [3]

Вот тебе юнит. Надеюсь что знаешь как его подключить и вызвать процедуры?

unit Crypt32;
{
* Description: 32 bits encode/decode module
* 2^96 variants it is very high to try hack
*Purpose: Good for encrypting passwors and text
*Security: avoid use StartKey less than 256
* if it use only for internal use you may use default
* key, but MODIFY unit before compiling
* Call: Encrypted := Encrypt(InString,StartKey,MultKey,AddKey)
* Decrypted := Decrypt(InString,StartKey)
* Parameters: InString = long string (max 2 GB) that need to encrypt
* decrypt *
* MultKey = MultKey key *
* AddKey = Second key *
* StartKey = Third key *
* (posible use defaults from interface) *
}

interface

const
StartKey = 981; {Start default key}
MultKey = 12674; {Mult default key}
AddKey = 35891; {Add default key}

function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
function Decrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;

implementation

{$R-}
{$Q-}
{*******************************************************
* Standard Encryption algorithm - Copied from Borland *
*******************************************************}
function Encrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
var
I : Byte;
begin
Result := "";
for I := 1 to Length(InString) do
begin
Result := Result + CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(Result[I]) + StartKey) * MultKey + AddKey;
end;
end;
{*******************************************************
* Standard Decryption algorithm - Copied from Borland *
*******************************************************}
function Decrypt(const InString:string; StartKey,MultKey,AddKey:Integer): string;
var
I : Byte;
begin
Result := "";
for I := 1 to Length(InString) do
begin
Result := Result + CHAR(Byte(InString[I]) xor (StartKey shr 8));
StartKey := (Byte(InString[I]) + StartKey) * MultKey + AddKey;
end;
end;
{$R+}
{$Q+}

end.



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

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

Наверх





Память: 0.44 MB
Время: 0.003 c
1-32212
Сержик
2002-01-25 09:26
2002.02.11
Как сделать чтобы


3-32169
Dmitry V. Averuanov
2002-01-16 16:11
2002.02.11
Не удается поставить CTLibComps для D6 (WinXP)


7-32361
amamed_3071
2001-11-05 13:50
2002.02.11
Печать на принтер с командами


14-32330
chajnyk
2001-12-21 09:13
2002.02.11
Запуск програм


3-32154
Hawk2
2002-01-16 11:48
2002.02.11
Помогите с кодировкой!!!





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский