# Simple .hta Encryption problem

Page 1 of 1

## 1 Replies - 1688 Views - Last Post: 07 May 2013 - 10:08 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=320483&amp;s=2d6c8530820a066bcb1eea121a4e33db&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 seanyp63

Reputation: 0
• 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..

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.

Test message:
The rain in Spain falls mainly on the plain.
Output should be:
Ujh\$wbkq\$no"Vtfjp#jfmnv\$rbkqp~!qq\$yig#…

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

<FORM NAME="ValidForm">
<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

Is This A Good Question/Topic? 0

## Replies To: Simple .hta Encryption problem

### #2 andrewsw

• Well, I'll need some beer.

Reputation: 4976
• Posts: 18,841
• 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..?

Quote

Make a better encryption program ..