It is currently Sun May 28, 2017 3:34 am



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: encrypted files read and write
Unread postPosted: Mon Feb 15, 2016 2:28 pm 
Offline
User avatar

Joined: Tue Nov 04, 2014 7:12 am
Posts: 124
file read and write
NO decryption - no error if changed
only read and encrypt and comparison...
(I wrote earlier, I use)
(it is only good if it's OK to see the details - but they can not change.
eg. game score etc.)

!code:
GR.OPEN 255, 0, 0, 0
GR.SCREEN w,h
psw$=str$(2*w*h) % or whatever
DIM dat$[6],kd$[6] %number of datas (now 6)
fname$="proba20.rfo"

dataread:
file.exists a,fname$
if a=0 then goto ide3
TEXT.OPEN R, FN1, fname$
for n= 1 to 6
TEXT.READLN FN1, dat$[n]
TEXT.READLN FN1, kd$[n]
encrypt psw$,dat$[n],kd3$
if kd3$<>kd$[n]then a=0
if a=0 then f_n.break
next n
TEXT.CLOSE FN1

ide3:
if a=0 then %file not exist or changed / add values
dat$[1]= "...."
dat$[2]= "...."
dat$[3]= "...."
gosub writedata
ENDIF
! use original loaded values dat$[]
!...
!...
end
writedata:
TEXT.OPEN W, FN1, fname$
for n= 1 to 6
encrypt psw$,dat$[n],kd$[n]
TEXT.WRITELN FN1, dat$[n] %uncoded data
TEXT.WRITELN FN1, kd$[n] %coded data
next n
TEXT.CLOSE FN1
return

_________________
"Unfortunately I only BASIC to understand. Everything else I need strong help..." :P


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
suspicion-preferred