Dear,Welcome to the board.
So far with read your script. In some circumstances it has some usefull
possibilities.
The output result is indeed unreadable and such a piece of code is hard
to manipulate without the complete software (encrypt+decrypt parts).
It need some additional work for maintain and transfer the encrypted key to
a script, but it make it hard to modify it.
To make it hard to analyze your decryption part we transfer your code.
We have convert your variable names to mnemonic code.
uncompressed version
code:
FUNCTION Decrypt($x1,$x2)
FOR $x3=1 TO $x2 STEP 1
?"Decrypt gets this input: $x1, $x2"
GLOBAL $x4
GLOBAL $x5
$x6=""
$x5=""
$x4=Split($x1,"!")
FOR EACH $x7 IN $x4
$x8=Len($x7)
?
?"Length of the encrypted Array Element= $x8"
$x9=$x8/2 ;Would like to see the INT change in FLOAT, but in KIX "/" always returns INT
IF $x9*2 <> $x8 ;Hence this trick
$x9=1,2
ENDIF
$x10=VarType($x9)
SELECT
CASE
VarType($x9)=3 ;An even element - Read in groups of 2
FOR $x11=0 TO $x8-1 STEP 2
$x12=Substr($x7,$x11+1,2)
$x13=CHR($x12)
$x5="$x5" + "$x13"
? "Unencrypted cell = $x13"
NEXT
CASE
1
FOR $x11=0 TO $x8-4 STEP 2 ;An odd element -Read in groups of 2 until last 3
$x12=Substr($x7,$x11+1,2)
$x13=CHR($x12)
? "Unencrypted cell = $x13"
$x5="$x5" + "$x13"
NEXT
? "The encrypted String this far $x5"
$x14=Substr($x7,$x8-2,3)
$x14=CHR("$x14")
? "The last Cell of 3: $x14"
$x5="$x5" + "$x14"
ENDSELECT
NEXT
?
? "The inverted, decoded String = $x5, Now inverting..."
?
$x15=Len($x5)
DIM $x16[$x15]
DIM $x11,$x17
$x11=0 $x17=0
FOR $x11=0 TO $x15-1 STEP 1
$x16[$x11]=Substr($x5,$x15-$x11,1)
?"Array this far = "+ $x16[$x11]
NEXT
FOR EACH $x18 IN $x16
$x6="$x6" + "$x18"
NEXT
$x1=$x6
NEXT
$decrypt="$x6"
ENDFUNCTION
compressed version (by tool kixstrip):
code:
function Decrypt($x1,$x2) for $x3=1 to $x2 step 1 global $x4 global $x5 $x6="" $x5=""
$x4=Split($x1,"!") for each $x7 in $x4 $x8=Len($x7) $x9=$x8/2 if $x9*2<>$x8 $x9=1,2 endif
$x10=VarType($x9) select case VarType($x9)=3 for $x11=0 to $x8-1 step 2 $x12=Substr($x7,$x11+1,2)
$x13=CHR($x12) $x5="$x5"+"$x13" next case 1 for $x11=0 to $x8-4 step 2 $x12=Substr($x7,$x11+1,2)
$x13=CHR($x12) $x5="$x5"+"$x13" next $x14=Substr($x7,$x8-2,3) $x14=CHR("$x14") $x5="$x5"+"$x14" endselect
next $x15=Len($x5) dim $x16[$x15] dim $x11,$x17 $x11=0 $x17=0 for $x11=0 to $x15-1 step 1
$x16[$x11]=Substr($x5,$x15-$x11,1) next for each $x18 in $x16 $x6="$x6"+"$x18" next
$x1=$x6 next $decrypt="$x6" endfunction
Code has been checked and programs still works.
!!!! remark 20011020: layout of one-line has been modify to prevent an unwanted format of this board topic. !!!!
!!!! !!!!
!!!! see later: how to create such one-line statement !!!!
Greetings.
btw: to prevent more security we are using our tools codec and compress.
Complete code is unreadable, but not unbreakable with the right tools.
[ 20 October 2001: Message edited by: MCA ]