1 Replies - 2072 Views - Last Post: 07 May 2013 - 10:08 AM Rate Topic: -----

#1 seanyp63   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-May 13

Simple .hta Encryption problem

Posted 07 May 2013 - 09:56 AM

This .hta problem is driving me crazy as I know I am close to solving it..


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.

Test message:
The rain in Spain falls mainly on the plain.
Output should be:

So Far, this is what I came up with
<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)

TheForm.output.value = string2

End Sub

<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>


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

Is This A Good Question/Topic? 0
  • +

Replies To: Simple .hta Encryption problem

#2 andrewsw   User is online

  • blow up my boots
  • member icon

Reputation: 6549
  • View blog
  • Posts: 26,555
  • Joined: 12-December 12

Re: Simple .hta Encryption problem

Posted 07 May 2013 - 10:08 AM

VBScript does not have the increment ++ operator.

How is this not homework, or an assignment..?


Make a better encryption program ..

reads exactly like homework.

This post has been edited by andrewsw: 07 May 2013 - 10:10 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1