On Mon, 21 Oct 2002 13:55, vss wrote: > Hi all. > > I am just working on a wee project at the moment, and I wanted to save a > items in a list to file. > I ALSO wanted the data to be a bit jumbled to look at, just to put people > off. I.e. if it looks like HEX, people tend to leave files alone. > > To my HORROR !! I opend the file up in note pade, only to fine it was > plain text :-( :-(
I have a component which is both a XML parser/writer and allows you to save to a file in encrypted format. You just set the password for the file and call its SaveToFile( "filename" ) method. Then to load just set the password and call LoadFromFile( "filename" ). Although its easy to use the encryption is very strong - well at least as strong as the password is secure. Since security is not vital you can hard code the password in your code. For serious security I should point out that the 'password' can be any length - it is passed through a MD5 routine before being used as the key material for AES. What also occured to me was running the input XML through a compressor prior to encryption. This way it speeds things up, as : 1. Compressing the data reduces the amount of time the encryption will take. 2. Reducing the amount of data means there is less data for the HDD to store and retrieve - and is thus faster. It might be faster to compress and encrypt than to store text directly to disk! I'll have to implement compression at some stage. Regards, Peter --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/