Hot Chick with Double D's needs help

Apollo Creed
06-12-2003, 03:24 AM
Im trying to make a encryption program with visual basic that will read the text in a text box. change the individual characters to the next letter in the alphabet in a seperate textbox.then reverse the encrypted text in another text box, this is what ive got so far:

Private sub cmdEncrypt_click()

Dim num as integer
For num= 1 to len(txtIn.text)
txtOut.Text=txtIn.Text
num=Asc(txtIn.Text)
txtOut.Text=Chr(num+1)
Next num
Text3.text=Str reverse(txtOut.Text)
End sub

The problem im having is that it will only read one letter
of the text at a time.

ASAP Help will be gratefully appreciated


Thanx

JordanChris
06-12-2003, 04:31 AM
RE: >>>> Hot Chick with Double D's needs help
Prove it!


Private sub cmdEncrypt_click()
Dim num as integer
txtOut.Text = ""
For num= 1 to len(txtIn.text)
NextLetterAsc=Asc(mid(txtIn.Text,num,1))
NextLetter = Chr(NextLetterAsc + 1)
txtOut.Text = txtOut.Text & NextLetter
Next num
' Now you can reverse it
End sub

Banjo
06-12-2003, 05:55 AM
Reversing the string is a simple matter of using the StrReverse function.

Also, remember that if NextLetterAsc is greater than 255 then you must loop back to 0.

davencharleston
06-12-2003, 07:24 AM
just outta curiousity, why do it this way? doesn't seem like very strong encryption...

why not try and come up with a really cool math formula and base your encryption on that?

hot chick with double d's....c'mon....hot chicks with double d's don't code....i know....there were 4 girls in the comp sci dept at clemson and not one of them was even remotely hot....well, maybe just one but she had about double a's....not d's...anyways, good luck...

DrPunk
06-12-2003, 08:17 AM
Ceasar's Shift must be everybody's introduction to encryption. Give the guy a break. It's better than nothing.

And is it not fair to assume that if someone is having trouble looping over the character's of a string, then they might have trouble implementing some ingenious encryption algorithm (no offence meant Apollo Creed, we all have to start somewhere). It's all about the basics. Get them sorted and who know's what will happen next!

13 Ways 2 Bleed
06-14-2003, 09:01 PM
For I = 1 len(text1)
temp = abs(asc(mid(Text1, I, 1)) - 255)
NewText = NewText & chr(temp)
Next I


Text1 is the input variable.
NewText is the output variable.

This is also a simple encryption method for newbies. This will encrypt and decrypt. A good little sniplet for learners.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum