06-21-2003, 05:04 AM
06-24-2003, 09:37 AM
Here's something i come up with... when i wasn't sober....
DECLARE FUNCTION Rotate$ (Text$)
DECLARE FUNCTION Cipher$ (Text$, Key$)
CLS
NormalString$ = "I Can't Goto Sleep The Clowns Will Eat Me"
Key$ = "QbAsIcNeWs..."
CipherdText$ = Cipher$(NormalString$, Key$)
DeCipherd$ = Cipher$(CipherdText$, Key$)
PRINT "Orignal- "; NormalString$
PRINT "Cipherd- "; CipherdText$
PRINT "DeCipherd-> "; DeCipherd$
PRINT STRING$(80, "-")
PRINT "Orginal Len-"; LEN(NormalString$)
PRINT "Cipherd Len-"; LEN(CipherdText$)
PRINT "DeCipherd Len->"; LEN(DeCipherd$)
SYSTEM
DEFINT A-Z
FUNCTION Cipher$ (Text$, Key$)
DIM L AS LONG
DIM D AS LONG
DIM X AS LONG
X& = 1
OldKey$ = Key$
FOR I = 1 TO LEN(Text$)
Key.I = Key.I + 1
IF Key.I > LEN(Key$) THEN Key.I = 1
C = (ASC(MID$(Text$, I, 1)) XOR (ASC(MID$(Key$, Key.I, 1)) * I)) AND 255
Enc$ = Enc$ + CHR$©
L = L + 7
D = D + 4
X = ((X + (SQR((X XOR (D MOD X))) * (64 + (L * D) - I))) AND 4095) XOR I
IF X Mod (L + D) < I THEN Key$ = Rotate$(Key$)
NEXT
Key$ = OldKey$
Cipher$ = Enc$
END FUNCTION
FUNCTION Rotate$ (Text$)
N$ = SPACE$(LEN(Text$))
FOR I = 2 TO LEN(Text$)
MID$(N$, I - 1) = MID$(Text$, I, 1)
NEXT
MID$(N$, LEN(N$)) = MID$(Text$, 1, 1)
Rotate$ = N$
END FUNCTION
DECLARE FUNCTION Rotate$ (Text$)
DECLARE FUNCTION Cipher$ (Text$, Key$)
CLS
NormalString$ = "I Can't Goto Sleep The Clowns Will Eat Me"
Key$ = "QbAsIcNeWs..."
CipherdText$ = Cipher$(NormalString$, Key$)
DeCipherd$ = Cipher$(CipherdText$, Key$)
PRINT "Orignal- "; NormalString$
PRINT "Cipherd- "; CipherdText$
PRINT "DeCipherd-> "; DeCipherd$
PRINT STRING$(80, "-")
PRINT "Orginal Len-"; LEN(NormalString$)
PRINT "Cipherd Len-"; LEN(CipherdText$)
PRINT "DeCipherd Len->"; LEN(DeCipherd$)
SYSTEM
DEFINT A-Z
FUNCTION Cipher$ (Text$, Key$)
DIM L AS LONG
DIM D AS LONG
DIM X AS LONG
X& = 1
OldKey$ = Key$
FOR I = 1 TO LEN(Text$)
Key.I = Key.I + 1
IF Key.I > LEN(Key$) THEN Key.I = 1
C = (ASC(MID$(Text$, I, 1)) XOR (ASC(MID$(Key$, Key.I, 1)) * I)) AND 255
Enc$ = Enc$ + CHR$©
L = L + 7
D = D + 4
X = ((X + (SQR((X XOR (D MOD X))) * (64 + (L * D) - I))) AND 4095) XOR I
IF X Mod (L + D) < I THEN Key$ = Rotate$(Key$)
NEXT
Key$ = OldKey$
Cipher$ = Enc$
END FUNCTION
FUNCTION Rotate$ (Text$)
N$ = SPACE$(LEN(Text$))
FOR I = 2 TO LEN(Text$)
MID$(N$, I - 1) = MID$(Text$, I, 1)
NEXT
MID$(N$, LEN(N$)) = MID$(Text$, 1, 1)
Rotate$ = N$
END FUNCTION
06-27-2003, 01:44 AM
one and a half weeks, since i'll be disappearing for a while..
06-27-2003, 11:04 AM
Excellent, there's been a lot of interest, hasn't there. But I thought this thread had died... so it's good.
07-04-2003, 07:46 AM
Yes i know it's been 6 days since the last post and that this thread is most likely dead but i have a very bad encryption program. and i want to post it
Yes very simple. but if you are dumb it may take you a minute or two to figure it out. j/k. :wink:
Code:
CLS
INPUT text$
x$ = " ~!@#$%^&*()_+{}|:<>?`-=[]\;',./1234567890qetuoadgjlxvnwryipsfhkzcbmMBCZKHFSPIYRWNVXLJGDAOUTEQ"
x2$ = "QETUOADGJLXVNWRYIPSFHKZCBMmbczkhfspiyrwnvxljgdaouteq0987654321/.,';\][=-`?><:|}{+_)(*&^%$#@!~"
FOR i = 1 TO LEN(text$)
tmp = INSTR(x$, MID$(text$, i, 1))
IF tmp <> 0 THEN
tmp2$ = MID$(x2$, tmp, 1)
f$ = f$ + tmp2$
END IF
NEXT
PRINT f$
Yes very simple. but if you are dumb it may take you a minute or two to figure it out. j/k. :wink:
07-04-2003, 07:58 AM
Out of interest, is anyone collecting an archive of these programs, because I'll happily do it for QBNZ (I have a whopping 30+ files to add, which have been made available to me in the space of one week!)
If I don't hear anything by tomorrow I'll do it anyway, but of course you have the right to request that it disappears from QBNZ at any time.
If I don't hear anything by tomorrow I'll do it anyway, but of course you have the right to request that it disappears from QBNZ at any time.
07-09-2003, 05:10 AM
without any effort, I can declare Mango the winner (surely a no-brainer?), and everyone else ties second place.
07-09-2003, 05:11 AM
YEah 2nd place!!!!!
07-22-2003, 07:54 AM
Why complicate things, you can't break any decryption without the key no matter what. So an XOR cryption will do fine for most things. And it's small too.
Code:
defint a-z
function xorEncrypt$ ( src as string, ekey as string )
dim i as integer
dim dst as string
dim keyLen as integer
keyLen = len( ekey )
for i = 1 to len ( src )
dst = dst + chr$( asc(mid$( src, i, 1 )) xor _
asc(mid$( ekey, i mod keyLen + 1, 1 )) )
next i
xorEncrypt$ = dst
end function
defint a-z
function xorDecrypt$ ( src as string, ekey as string )
dim i as integer
dim dst as string
dim keyLen as integer
keyLen = len( ekey )
for i = 1 to len ( src )
dst = dst + chr$( asc(mid$( src, i, 1 )) xor _
asc(mid$( ekey, i mod keyLen + 1, 1 )) )
next i
xorDecrypt$ = dst
end function
07-22-2003, 08:07 AM
Quote:Why complicate things, you can't break any decryption without the key no matter what. So an XOR cryption will do fine for most things. And it's small too.Incorrect. I broke the first encryption technique using english language letter frequency.