Thanks for all the responses, help and suggestions.

I have done it with encoding/decoding and I have used file.locked to save the 
file in a locked state so that its contents cannot be altered unless unlocked, 
and hopefully the file cannot become corrupted, again unless if unlocked. 

I have not made the file invisible because it will need to be visible to open 
under normal circumstances.

Thanks in advance William for your snippet to use XOR, I will definitely use it 
to improve security.

Thanks again all.

Lennox

William Squires <[EMAIL PROTECTED]> wrote:    Just keep in mind that encoding 
(rather than encrypting) a file is  
just to keep honest people honest - a hacker (or someone determined  
to crack your high score file...) will get in in a flash. If you  
determine that an encoding (rather than encryption) is acceptable, at  
least don't use a simple substitution cypher; use XOR (BitwiseXOR)  
with a rotating key to make it more difficult. An example of a  
symmetric encoding function (in this context, a "symmetric" function  
is one that's its own inverse) is:

Function EncodeDecode(s As String) As String
   Dim i As Integer
   Dim l As Integer
   Dim theCh As String
   Dim result As String

   result = "" // so I'm retentive about initializing variables,  
okay? :)
   l = LenB(s)
   For i = 1 To l
     theCh = MidB(s, i, 1)
     result = result + ChrB(BitwiseXOR(AscB(theCh), (128 + 
constant> * i) Mod 256))
   Next
   Return result
End Function

On Apr 14, 2007, at 7:11 PM, Christian Schmitz wrote:

> Lennox Jacob  wrote:
>
>> Hello,
>>
>> My app save its files as text documents.
>>
>> Is it possible for me to scramble the text on saving (and  
>> descramble on
>> opening) so that it is not easily read if opened by any text  
>> editor app?
>>
>
> Sure.
> Can be as easy as walking over all ascii characters in a string and
> adding 20 to the values. Simple, but often enough.
>
> Gruß
> Christian
>
> -- 
> Around twelve thousand functions in one REALbasic plug-in.
> The Monkeybread Software Realbasic Plugin v7.0. Now universal!
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> 
>
> Search the archives:
> 

_______________________________________________
Unsubscribe or switch delivery mode:


Search the archives:



       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to