Re: writing data

new topic     » goto parent     » topic index » view thread      » older message » newer message

>I have been working on a workout program that I wrote in qbasic and I
>was storing the user info in a file. I was using two seq to stroe the
>info, the first has all the names of the users and the second has all
>the info on them. I read/write them using get()/print() but if you open
>the file you can see the seq, any body have any ideas on a better way to
>store info in a file so it cannot be read by noise people who might try
>and mess with it. any suggesting?


Well, EDOM2 emulates get () and print () in an efficient, unreadable for
non-euphorians form.
However, any Euphorian could just load up the sequence using EDOM2.
To prevent this, you could use a "compression handler" also known as custom
I/O Device, so you can filter the data. You could also  manipulate the
sequence before you save it:

err_code = edo_save ("myedo.edo", not_bits (my_seq * 3 - 123), CP_NONE)
if err_code then
    puts (1, "Error occured:" & EDO_ERRORS[err_code] & '\n')
    abort (1)
end if

-- By using not_bits ( my_seq * 3 - 123) you have made the data in my_seq a
bit less understandable.
-- To load it back up, you must:

data_file = edo_load ("myedo.edo", CP_NONE)
if integer (data_file) then
    puts (1, "Error occured:" & EDO_ERRORS[data_file] & '\n')
    abort (1)
end if
data_file = (data_file + 123) / 3

-- Now data_file contains the same data, however it was saved it an
unreadable form, which is also hard to understand, even if some1 decrypts it
using EDOM2

BTW Do not think, "you need a lot of code to use EDOM2, compared to print()
/get ()", cause this code also insolves all sort of possible disk errors
that could occur.

You could off course also do some calculation with the data, but not use
EDOM2, this would give non-euphorians the same chance to crack the data as
euphorians.

Last suggestion I have:
You could also save a file and write out the data using print () and get (),
but then you put this piece of info in front of it: "global constant DATA =
" then you could use shroud and let it get encrypted by EUphoria. This off
course only works if the end-user program doesn't need to save any info.

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu