home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
totallyamos
/
issue2
/
programming
/
ben.seq
< prev
next >
Wrap
Text File
|
1991-09-02
|
5KB
|
127 lines
124
aaa00ff23fe0080333001d5b
^2<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
^3P R O G R A M P A R L O U R
^2The definitive guide to AMOS programming
^1by Ben Ashley
^2<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
^7 This part of `Totally Amos', is a sort of...well, a guide, hintbook,
^7listing book, etc. And over the months, I`ll be uncovering routines,
^7and giving a helping hand to anyone who needs it. I remember when I
^7first got AMOS. Wow, did it look daunting or what? Even with such
^7good helplines around. Still, I`ve got to grips with it, and here I
^7am now, speaking to you.
^5 This issue, I`m going to be looking at Password Protection. It is a
^5scheme, that I`ve been planning for a couple of months now. I have a
^5few BETA tests, but I have yet to get round to writing and compiling
^5a full blown protection kit. So, without further ado, I`m going to
^5set off on some theory work.
^7 However good the protection, you can bet your life, it can be
^7cracked. So rather than set sail on the waters of impossibility, I`m
^7going to embark on the project of the lesser-technical minded. If
^7you couldn't make head nor tail of that last sentence, what I`m
^7trying to say is, my Password Project is to protect your disks,
^7against the people who are NOT hardened crackers. Problem is, a lot
^7of people are reading this article and finding out how certain ones
^7work. Change them if you wish, the idea is there, and it`s only
^7supposed to keep fellow companions and family out of your private
^7life.
^2THE PASSWORD PROGRAMS
^5 There will only really be 2 main programs you`ll need to write. One
^5which installs passwords onto disks, and another compiled program
^5which can be put in a startup-sequence, e.t.c.
^2THE PASSWORD ITSELF
^7 When asking for a password to be put on the disk, we`ll say that it
^7should be held in string P$. O.k, to save this password, it`ll go in
^7an ASCII file. GREAT! I hear you cry, people can just look at it!
^7So here comes the interesting part. The encryption. You could use a
^7routine like the following:
^6 L=Len(P$)
^6 For F=1 To L
^6 Mid$(P$,F,1)=Chr$(Asc(Mid$(P$,F,1))+5)
^6 Next F
^5 This should change the values of the Ascii characters, so it looks
^5like a load of junk. And then you`d save it as a sequential file.
^7 Now, in the PASSWORD PROTECTION PROGRAM, to Decrypt the password all
^7you have to do is......
^6 L=Len(P$)
^6 For F=1 To L
^6 Mid$(P$,F,1)=Chr$(Asc(Mid$(P$,F,1))-5)
^6 Next F
^7 This should get the password back to it`s original state.
^7 So, a fully blown routine could look something like:
^6 Input "Please enter the New Password:";P$
^6 L=Len(P$)
^6 For F=1 To L
^6 Mid$(P$,F,1)=Chr$(Asc(Mid$(P$,F,1))+5)
^6 Next F
^6 Open Out 1,"Df0:File.X"
^6 Print #1,P$
^6 Close 1
^6 Edit
^7And the checking program......
^6 Open In 1,"Df0:File.X"
^6 Input #1,P$
^6 Close 1
^6 For F=1 To L
^6 Mid$(P$,F,1)=Chr$(Asc(Mid$(P$,F,1))-5)
^6 Next F
^6 Input "Please enter the Password:";PASS$
^6 If PASS$=P$
^6 End
^6 End If
^6 Do
^6 Curs Off
^6 Amos To Front
^6 Loop
^7 Of course, you`ll have to add, a good screen ( ie: 2 colour, hi-res
^7), and when you`ve made sure you`ve got it right. Add BREAK OFF. In
^7the Password Program I wrote, I put the command Amos To Front in the
^7loop.
^5 This meant, if any person who had failed to put the password in
^5correctly, and tried to switch screens using AMIGA-A, could not, as
^5the AMOS screen would always be brought to the front.
^7 So what have I included as source? Well, to give you an idea of
^7what I`m talking about, I`ve provided you with THREE, yes THREE
^7programs. These are:
^2 Password-Installer.AMOS
^2 Password-Protection.AMOS
^2 Password-Cracker.AMOS
^7 The first two are self explanatory. The first is the one you place
^7a password in, the second gets compiled and put in a
^7startup-sequence, and the third..... Just in case you forget your
^7password, this one cracks passwords.
^2 Well, Tally-Ho, and enjoy your Password Programming. See you next
^2issue... BYE!
^2<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
\