Вниз
Скачать: CL | DM;

Crypt   Найти похожие ветки 

 
LYNXic ©   (2002-10-16 15:08) [0]

Почему этот код шифрует не весь текст, а только примерно 70-80 символов

unit Crypt32;

interface

const
StartKey = 981;
MultKey = 12674;
AddKey = 35891;

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

implementation

{$R-}
{$Q-}

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;
{$R+}
{$Q+}

end.


 
McSimm ©   (2002-10-16 15:12) [1]

Этот код был написан для строк длиной < 256 символов.
Замени в обоих функциях

I : Byte;
на
I : Integer;
Все заработает.



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

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.018 c
3-92365
Bishop
2002-10-07 18:52
2002.10.28
TpFibTransaction


14-92717
Anatoly Podgoretsky
2002-10-04 09:26
2002.10.28
С днем рождения Павел Озерский


4-92820
Карлсон
2002-09-17 17:59
2002.10.28
как поменять иконку?


6-92635
Akni
2002-08-27 22:53
2002.10.28
Sockets


1-92516
123000
2002-10-14 20:41
2002.10.28
Richedit




   Наверх