Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.06.20;
Скачать: CL | DM;

Вниз

не сильно сложный алгоритм шифрования   Найти похожие ветки 

 
psv   (2002-05-28 15:44) [0]

Люли. Кто знает хороший, но не сильно
сложный алгоритм шифрования.
Суть в том что-б писать в базу зашиврованые записи


 
Johnmen ©   (2002-05-28 15:59) [1]

Ой, Люли-Люли...
Придумать сами не смогли ?


 
vopros ©   (2002-05-28 16:10) [2]

>psv (28.05.02 15:44)
Зашифровать недолго. Ты сначала подумай как смотреть их будешь.


 
mrcat ©   (2002-05-28 16:33) [3]

Было бы логичным шифровать не записи, а БД целиком (если она не большая)...


 
Andrey ©   (2002-05-28 20:00) [4]

Вообще в интернете выложена куча таких алгоритмов, если не нашел значит плохо искал, если не искал поищи.

Непомню где содрал:

{
Sample application of the XOR algorithm for a simple
Crypt program

Author: Colin Laplace (webmaster@bloodshed.nu)

Public domain. Use this program at your own risk, and don"t use
it if you are not allowed in your country/state
}
program Crypt;
{$APPTYPE CONSOLE}
uses Windows;

var key, text, longkey, result : string;
i : integer;
toto, c : char;
F : TextFile;
begin
writeln("Enter the key:");
readln(key);
writeln("Enter the text:");
readln(text);

for i := 0 to (length(text) div length(key)) do
longkey := longkey + key;

for i := 1 to length(text) do begin
toto := chr((ord(text[i]) XOR ord(longkey[i]))); // XOR algorithm
result := result + toto;
end;
writeln("The crypted text is:");
writeln(result);
write("Should i save it to result.txt ?");
read(c);
if c in ["Y","y"] then begin
AssignFile(F,"result.txt");
Rewrite(F);
Writeln(F,result);
CloseFile(F);
end;
end.



{
Sample application of the XOR algorithm for a simple
Decrypt program

Author: Colin Laplace (webmaster@bloodshed.nu)

Public domain. Use this program at your own risk, and don"t use
it if you are not allowed in your country
}
program Decrypt;
{$APPTYPE CONSOLE}
uses Windows;

var key, c_text, longkey, result : string;
i : integer;
toto : char;
F : TextFile;
begin
writeln("Enter the key:");
readln(key);
writeln("Please make sure you have the file "result.txt" in the current directory");
// it takes the output file from Crypt.exe
AssignFile(F,"result.txt");
Reset(F);
Readln(F,c_text);
CloseFile(F);

for i := 0 to (length(c_text) div length(key)) do
longkey := longkey + key;

for i := 1 to length(c_text) do begin
toto := chr((ord(c_text[i]) XOR ord(longkey[i]))); // XOR algorithm
result := result + toto;
end;
writeln("The decrypted text is:");
writeln(result);
readln;
end.


 
psv   (2002-05-28 21:10) [5]

Спасибо большое



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

Текущий архив: 2002.06.20;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.013 c
7-65268
CaSHe
2002-03-22 16:07
2002.06.20
Работа со шрифтами


3-64924
ZDN
2002-05-25 22:26
2002.06.20
Бизнес-логика


1-65005
zeos
2002-06-08 11:13
2002.06.20
Как избавиться от перерисовки формы?


4-65274
Nimble
2002-04-19 04:39
2002.06.20
Form


3-64992
pashtet
2002-05-27 17:20
2002.06.20
Как с работать с локальной БД без Альясов?