You are not logged in.
Post a reply
Topic review (newest first)
I meant an 'intelligent' method but you're quite right, anyway. I was reading the ASC(...MOD...) one incorrectly.
Nah. You can always brute-force it, but it takes a lot longer.
Curses! Well that certainly makes it much harder to discern the length of the original string. It might still be doable, but it would require
The entered strings can contain any ASCII characters, as well as numbers. It seems that I did forget the following:
Dim CompiledString As String Dim Output As String Dim x As Integer
Can you double check the output you gave? I'm assuming that the words are alpha only with upper and lower case. Examples I've tried
All right; I'll simplify the challenge: could you simply deduce the concatenated string from the end result?
No, it's fine the way you've done it.
Unless I made some huge mistake, which is possible, the only way to get back to the original string is the good ol' brute-force method.
I personally like VB, but I mainly use VBA with Excel. I'll have a go at this later. I think it's doable from a glance, but I'll need to play with it.
VB.net is much better than VB. Instead of buying it, you might like to try "SharpDevelop": http://www.icsharpcode.net/OpenSource/SD/ andlet us know if it is any good.
In VB, if the strings are numbers, the string + string adds the numbers, but, if they aren't numbers, it "concatenates" them.
The "string concatenation operator" is one of my main sources of bugs:
string & string -> puts the two strings together, in the order they are typed, to form one longer string
my god VB is more horrible a language than i ever believed, how can you bear working with it?
For x = 0 To 1 CompiledString = CompiledString & Password(x).Text Next CompiledString = CompiledString & UserName.Text For x = 1 To Len(CompiledString) Output = Output & Int(Asc(Mid(CompiledString, x, 1)) + Asc(Mid(CompiledString, Int(((x + Sqr(Len(Output))) Mod (Len(CompiledString) - 1)) + 1), 1))) Next
I will give high praise to anyone who thinks they know how to retrieve the original information and actually can.
UserName.text = afoiadfjanwief Password(0).Text = wedraixdn Password(1).Text = rhescaiufenxe Output = 21320613321521521313720022519321622014020622920020522023114221614781235202229213137230211142153220216199211202222221210230215201203226196197207223199211229225203216203211219194205222206211214220220200199224218202224217206217202221219201201217196207224222203212212152217201203210216206212207214198224203209206134
Output = 1811291842231331601942231331901811982221911291831291921982151981692092151401201292322052191872062231402101551412332202062296421515764156213212213233232205215133212139147172125199213206224148181218228215199218147227172207225216185205140184149211230198235116171219211142191208211