| View previous topic :: View next topic |
| Author |
Message |
mouse Member

Joined: 07 Oct 2003 Posts: 8
|
Posted: 28/10/03 20:33 Post subject: Code Data |
|
|
I need help to code my data before store it on data base and decode it when I want to use it
any help please _________________ Mouse @@@ |
|
| Back to top |
|
 |
Johnny_Bit Junior Member
Joined: 15 Jun 2003 Posts: 99
|
Posted: 29/10/03 19:14 Post subject: |
|
|
There are many ways of coding... you can try BlowFish (very good) IDEA, DSA, Triple DSA... but if you want simple coding try this: | Code: | function transcode(S,K:byte):byte;
var
i:integer;
begin
i:=s xor k;
if i>255 then
i:=i-255;
if i<0 then
i:=i+255;
result:=i;
end;
function EnCode(Source:String;Key:Byte):String;
var
i:integer;
begin
if length(source)=0 then exit;
Result:='';
for i:=1 to length(source) do
begin
Result:=Result+chr(transcode(ord(source[i]),key));
end;
end;
function Decode(Source:String;Key:Byte):String;
begin
Result:=Encode(source,key);
end;
|
|
|
| Back to top |
|
 |
mouse Member

Joined: 07 Oct 2003 Posts: 8
|
Posted: 31/10/03 22:41 Post subject: |
|
|
Thanks for your help _________________ Mouse @@@ |
|
| Back to top |
|
 |
|