26820 total geeks with 3505 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: Apr 30
April Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Next Windows
obsolescence panic
is 450 days from ?
NOW!
LOHAN and the
amazing technicolor
spaceplane
R.I.P. LADEE: Probe
smashes into lunar
surface at 3,600mph
Judge halts spread
of zombie Nortel
patents to Texas in
Google trial
Record labels sue
Pandora over
vintage song
royalties
True optical zoom
coming to HTC
smartphone cameras
Google lets wannabe
Glass Explorers
ADMIRE THEMSELVES
in their own
mirrors
Liftoff! SpaceX
Falcon 9 lifts
Dragon on third
resupply mission to
ISS
Leaked photos may
indicate slimmer
next-generation
iPad
Reddit users
discover iOS
malware threat
Slashdot
General Mills
Retracts "No Right
to Sue" EULA Clause
Drones On Demand
$42,000 Prosthetic
Hand Outperformed
By $50 3D Printed
Hand
Biofuels From Corn
Can Create More
Greenhouse Gases
Than Gasoline
L.A. Science
Teacher Suspended
Over Student
Science Fair
Projects
Why Portland Should
Have Kept Its
Water, Urine and
All
SpaceX Successfully
Delivers Supplies
To ISS
Ask Slashdot:
Professional
Journaling/Notes
Software?
Google Aids
Scientology-Linked
Group CCHR With
Pay-Per-Click Ads
Cody Wilson
Interview at
Reason: Happiness
Is a 3D Printed Gun
Article viewer

Yet another Qbasic example



Written by:dimport
Published by:dimport
Published on:2003-06-21 07:19:46
Topic:Miscellaneous
Search OSI about Miscellaneous.More articles by dimport.
 viewed 10411 times send this article printer friendly

Digg this!
    Rate this article :
Here is an encryption program that i made in Q basic. I basically compiled some prog's i found on the internet.


SCREEN 2: SCREEN 0: CLS

Menu:

LOCATE 1, 15: PRINT "CRYPTOR v1.0"

LOCATE 2, 15: PRINT "by ADAM PERRY & MATT OCHS"

LOCATE 3, 13: PRINT " Main Menu "

LOCATE 5, 10: PRINT "E]ncrypt message"

LOCATE 7, 10: PRINT "D]ecrypt message"

LOCATE 9, 10: PRINT "Q]uit Cryptor"

Loop1:

GOSUB GetKey: IF A$ = "E" THEN GOTO Encrypt ELSE IF A$ = "D" THEN GOTO Decrypt ELSE IF A$ = "Q" THEN GOTO Quit ELSE GOTO Loop1

GetKey:

A$ = UCASE$(INKEY$): IF A$ = "" THEN GOTO GetKey

RETURN

Encrypt:

CLS

PRINT "All information except for the file name is capitalization-snsitive."

PRINT "This means that capitalization will affect the message."

INPUT "Recipiant name"; N$

INPUT "File name"; F$

INPUT "Encrypt code"; C$

CLS

INPUT "Message text: ", M$

OPEN F$ + ".CPT" FOR OUTPUT AS #1

A = 0: B = 0: C = 0: CR$ = ""

DO WHILE A LEN(N$) THEN B = 1

C = C + 1: IF C > LEN(C$) THEN C = 1

D = ASC(MID$(M$, A, 1)) + ASC(MID$(N$, B, 1)) + ASC(MID$(C$, C, 1))

Loop2:

IF D > 255 THEN D = D - 255: GOTO Loop2

CR$ = CR$ + CHR$(D)

LOOP

WRITE #1, CR$: CLOSE

CLS : GOTO Menu:

Decrypt:

CLS

PRINT "All information exept the file name is capitalization-sensitive."

PRINT "This means that capitalization will affect the message."

INPUT "Recipiant name"; N$

INPUT "File name"; F$

INPUT "Encypt code"; C$

CLS : CR$ = ""

OPEN F$ + ".CPT" FOR INPUT AS #1

INPUT #1, CR$

CLOSE

A = 0: B = 0: C = 0: M$ = ""

DO WHILE A LEN(N$) THEN B = 1

C = C + 1: IF C > LEN(C$) THEN C = 1

D = ASC(MID$(CR$, A, 1)) - (ASC(MID$(N$, B, 1)) + ASC(MID$(C$, C, 1)))

Loop3:

IF D < 1 THEN D = D + 255: GOTO Loop3

M$ = M$ + CHR$(D)

LOOP

Menu2:

CLS

LOCATE 1, 15: PRINT "Cryptor v1.0"

LOCATE 2, 15: PRINT "by ADAM PERRY & MATT OCHS"

LOCATE 3, 13: PRINT "Decryption Complete"

LOCATE 5, 10: PRINT "V]iew message"

LOCATE 7, 10: PRINT "S]ave message"

LOCATE 9, 10: PRINT "Main menu"

Loop4:

GOSUB GetKey: IF A$ = "V" THEN GOTO ViewMessage ELSE IF A$ = "S" THEN GOTO Save

IF A$ = "M" THEN GOTO Menu ELSE GOTO Loop4

ViewMessage:

CLS : PRINT M$: GOSUB GetKey: GOTO Menu2

Save:

OPEN F$ + ".TXT" FOR OUTPUT AS #1

WRITE #1, M$

CLOSE : GOTO Menu2

Quit:

CLS : SYSTEM




Well, thats it.

This article was originally written by Apocolipse

Did you like this article? There are hundreds more.

Comments:
Anonymous
2007-10-11 21:25:37
You stringed all your variables wrong, A LEN is also incorrect. If you tried to run it, it would not work, 100% about that. Nice try though.
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:


Blogs: (People who have posted blogs on this subject..)
minmin
Nike Free Norway on Mon 21st Apr 10am
minmin
Nike Flex UK on Mon 21st Apr 10am
Get your notes and rewrite them especially for kinesthetic learners Nike Flex Womens UK , performing this would surely make your memory sharper Quite a few just planning to head out their particular playground pick a touring offer ( blank ) an exciting ar
minmin
Nike Free 5.0+ Norway on Mon 21st Apr 10am
minmin
Nike Huarache Free UK on Mon 21st Apr 9am
With Karen Millen Nike Huarache Free Mens UK , consumers know they are getting some of the best Always be well mannered There are several food items like vitamin supplement prepared cereal and dairy which provide Vitamin D, nevertheless it isnt humanly po
minmin
Nike Free Running Norway on Mon 21st Apr 9am
The client provider at toms shoes outlet is really an astounding one particular Maintain eyeliner to a minimal although It has plus sized tunics Nike Free Sale Norway , shirts, tops, slacks, denims, pants, capris, plus sized dresses, clothes, overcoats, m
minmin
Nike Flex Mens UK on Mon 21st Apr 9am
minmin
Nike Free 6.0 Mens UK on Mon 21st Apr 9am
Those who want to use affiliate marketing to make money online but are strapped financially there are several no cost ways to start earning commissions Warm it up by placing the moisturizer in a microwave-safe bowl and heating it up for approximately five
minmin
Nike Free Run+ Norway on Mon 21st Apr 9am
Action
First one on Tue 12th Jan 10pm
Yaw, this is the first blog post, just to begin with something. Nice site here, cool features like OSIDrive, and so on. However, strange that an "OpenSource Institute" uses non-OpenSource softare to host its site (Windows and IIS). It's not correct... I t
bb
A Daily Profanity at dailyprofanity.com on Mon 21st Dec 11am
For anyone who likes viz, and roger mellies profanisaurus. There's a website called amusing daily profanity which dishes up a humorous profanity every day via rss, twitter email and a few other ways. Rather rude words, but very funny in my opinion,


     
Your Ad Here
 
Copyright Open Source Institute, 2006