DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Code Data

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
mouse
Member


Joined: 07 Oct 2003
Posts: 8

PostPosted: 28/10/03 20:33    Post subject: Code Data Reply with quote

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
View user's profile
Johnny_Bit
Junior Member


Joined: 15 Jun 2003
Posts: 99

PostPosted: 29/10/03 19:14    Post subject: Reply with quote

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
View user's profile
mouse
Member


Joined: 07 Oct 2003
Posts: 8

PostPosted: 31/10/03 22:41    Post subject: Reply with quote

Thanks for your help
_________________
Mouse @@@
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group