Posts: 3,368
Threads: 195
Joined: Jan 2003
Code:
CLS
string1$ = "5"
FOR i% = 1 TO 4
string1$ = string1$ + "5"
PRINT STRING$(5 - LEN(string1$), "0") + string1$
NEXT i%
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 1,956
Threads: 65
Joined: Jun 2003
Your sample code produces:
00055
00555
05555
55555
If that's what you wanted, fine.
But it has nothing to do with the original subject of placing leading zeros on the Ascii code in order to always have a resulting 3 digit code.
Perhaps you wanted to show that a STRING$ could be used instead of the MID$ in my example. Ok, yes it could.
*****
Posts: 3,368
Threads: 195
Joined: Jan 2003
you are wrong, [Unknown].
I will post a program tomorrow to prove this.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Well, just in case I fail to live up to my promise, you decrypt your encryption, [unknown], but using a regular character frequency analysis. (see my reply to whitetiger's post). The only thing different is that you separate each part of the key. yeah.. after you get the keylength...it's coming to me...
Character length: Kasiski, randomness value .065
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 480
Threads: 24
Joined: Mar 2003
I feel like figuring out how to crack my encrypted text would be a real pain in the butt (of course it's easy if you look at the code and reverse the sequence):
1. it uses the text itself to create the values by which the letters change.
2. it uses three different values: the ascii value of the character in front of the current letter (CODED), the acsii value of the character after the current letter (UNCODED), and the position of the current letter within the string. It might be even more difficult to break if instead of using k% = k% + x%, it had some more obscure formula, like x% * sin(x%) or something like that.
Anyway, I'm prolly totally wrong, and there's most likely a really obvious way to decrypt it without knowing the pattern beforehand, but I don't see it off the top of my head.
I'd like to hear if anyone figures it out.
*peace*
Meg.
Posts: 3,368
Threads: 195
Joined: Jan 2003
Well, as far as I know, any ciphertext that is not completely random (any character is equally likely, and there is no pattern to the appearance of each character) is always breakable.
The way that it is done in AES (Advanced Encryption Standard) uses the password and the plaintext to repeatedly reorder and permute the characters.
So does the way I described in the first link. (hopefully clearly)
My algorithm, again:
1) combine password and plaintext like so (wraparound to end):
password bit / ciphertext bit / output bit
0 0 0
1 1 0
0 1 1
1 0 1
2) Separate each plaintext into powers of 2 partitions.
3) For each partition, convert every 2 bits like so:
11 >10
10 >11
01 > 01
00 > 00
P1, P2 > A > A1
So, it is rearranged in two parts A and A1. Then perform (1) on A again. A is then subdivided the same way again into A and A2, etc.. until A is just one digit long.
Then A becomes A + A1 + A2 + A3...etc.
4) Merge all the partitions back together.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 3,343
Threads: 83
Joined: Mar 2003
Hehe... wouldn't this be good.
Unencrypted: Hello, world!
Encrypted: aaaaaaaaaaaaa
Someone make that and I'll give them a medal.
note: any entry that encodes just one string to the above encrypted string is instantly proof of the maker's stupidity ;--)
Posts: 1,688
Threads: 119
Joined: Jun 2003
i found an encryption program on the net the other day... it allows you to choose your own key, and then how many times you want it to encode it.
Jumping Jahoolipers!
Posts: 3,343
Threads: 83
Joined: Mar 2003
For QB?
And I don't think choosing your own key is a very good idea, cos you'd get into using similar combinations of letters, or making up a "password" sort of key: an actual word (which wouldn't be a good idea).
Posts: 1,688
Threads: 119
Joined: Jun 2003
yep. but if you use your own key, it could be harder to hack. by that, i mean that if someone hacks one message, they can't hack the other message easily.
Jumping Jahoolipers!