THIS IS NOT HOMEWORK
Make a better encryption program by changing the offset every letter. Use a loop of 5 ( add one two three four five then start over)
For example, for the message “Hello John”, add 1 to H, 2 to e, 3 to l, 4 to l, 5 to o, 1 to space, 2 to J, 3 to o, 4 to h, and 5 to n, giving: Igopt!Lrls
Thus, the same letter does not get transformed to the same character throughout the message.
The rain in Spain falls mainly on the plain.
Output should be:
So Far, this is what I came up with
<HTML> <HEAD><TITLE>Message Encryption</TITLE> <script LANGUAGE="VBScript"> <!-- Sub Submit_onclick Dim TheForm Set TheForm = document.ValidForm string1 = TheForm.input.Value for i = 1 to len(string1) string2 = string2 & chr(asc(mid(string1,i,1)) ++i) next TheForm.output.value = string2 End Sub --> </SCRIPT> </HEAD> <BODY> <FORM NAME="ValidForm"> Enter your message here: <INPUT NAME="input" TYPE="TEXT" size=50> <br> The encrypted message is: <input name="output" type="text" size=50><br><br> <INPUT NAME="Submit" TYPE="BUTTON" VALUE="Encrypt"> </FORM> </BODY> </HTML>
However my encryption keeps going and I cannot figure out how to get the loop to work so it resets every 5 letters please let me know if anyone can help. Thanks!
This post has been edited by modi123_1: 07 May 2013 - 09:58 AM
Reason for edit:: fixed botched code tag