Dear,A very long story about the same encryption technology (= XOR usage), which can easily cracked. This was found in http://kixtart.org/board/Forum2/HTML/000392.html
The primary question was:
if there is a way to encrypt a script to prevent it from being modifyd?
Another method we are currently developing, which not only prevents modifying but also prevents cracking of it.
Goals:
- an user can not modify the code.
- decryption must be run very fast.
- cracking of code must be very hard.
Explanation:
- only encrypted code is located in the common folder (f.e. NETLOGON). code which is very hard to modify.
during decryption you can check of code has been changed or becomes damaged.
- an kixtart script for decryption is very slow. by testing a short script it takes too must time and it is comsuming a great lot of CPU time. a short script for me is about 250 lines.
by using another program language we get an enormous speed up. a script of 10.000 lines can be decrypted within 2 5 sec before starting running kix32.exe procedure.
- do not use only XOR encryption. we think about many elements:
- stripping Kixstart script first.
f.e. delete empty lines, remove comment statements, remove print statements when you are only using WRITE statements, change nice variable names to meaningless variable names (f.e. $x1, $x2, ..., $x999), combining separate lines to one line.
- compress kixtart script.
- calculate CRC value of script.
- encrypt script by XOR and/or other encryption techniques with a dynamic password
usage.
a dynamic password means: each time you are running the encryption/compression procedure the password will be different, which means the encrypt output file contains NEVER the same contents.
- make it possible to run the procedure over and over, so cracking because harder and harder.
Result of a script of 300.000 bytes is 40.000 bytes after using of compression and encryption techniques. Encryption cost about 10 20 seconds. Decryption cost about 2 5 seconds. The processor speeds influences these results.
example original script:
code:
;
; (c) KIX-INFO.KIX vs 375 - MCA 2000
;
; The software product is protected by copyright laws and international
; copyright treaties, as well as other intellectual property laws and
; treaties. The SOFTWARE PRODUCT is licensed, not sold.
; License agreement expires after six months of publication. You may
; install only one copy for one server domain.
;
; If you want to use the software for any (new) purpose you needs a li-
; cense agreement, which can only be delivered by creator and owner of
; this software.
;
example encrypted file without compression:
code:
begin: (c) MCA - 2000 (2000159 wed 07-jun-2000 19:17:36)
͈ͪݟژыߺᐻ̋
ͨ㌼˦¦«Ŗံ鹞ҽ
ͬ珸ќĖĹΣ廕
Մʉָ⋩LJ
ͬɨ잱ŵԅэؑުҨ۟Ղ
ͿЉςڋŒȯ㌯
ͬ˸ߌѰǓʠʿֹᯱܗ
ͽܸꏼіͿʺׄ敻
;شâຒə͉ײʮƪӇŎޗ𬋺
ҵԀԓ¤֡߹ָ⋩̏
Ϳàш˺Åໂ
ͺꏼáςԥۣӫՆဪ
ͬȴáŘͯӯߙ廘
àԅЍҗҴ
end: completed.
end: crc16=1534
example encrypted file with compression:
code:
begin: (c) MCA - 2000 (2000159 wed 07-jun-2000 19:17:36)
ʡ
end: completed.
end: crc16=48370
Another example is:
code:
IF (@inwin = 1)
$NT_mode="yes"
ELSE
$NT_mode="no"
ENDIF
;
$memory=0
IF ($NT_mode = "yes")
;
;Physical Memory (K)
; Total: 64,948
; Available: 31,840
; File Cache: 14,652
;
IF (Exist("c:\temp\@wksta.txt") = 1)
del "c:\temp\"+@wksta.txt
ENDIF
cd "c:\temp"
shell "%comspec% /c winmsd /s /f" ; - /s = summary; /f = to file -
shell '%comspec% /c type '+@wksta.txt+' | find " Total:" >c:\temp\memory.txt'
;
IF (Open(9,"c:\temp\memory.txt") = 0)
WHILE (@error = 0)
$result=ReadLine(9)
$pos=INSTR(LCASE($result), "total:")
IF ($pos <> 0)
$memory=substr($result,$pos+6,len($result)-$pos-1)
ENDIF
LOOP
IF (CLOSE(9) <> 0)
ENDIF
ENDIF
ELSE
;
;Memory Type Total Used Free
;---------------- -------- -------- --------
;Conventional 640K 86K 554K
;Upper 0K 0K 0K
;Reserved 0K 0K 0K
;Extended (XMS) 65.472K ? 129.764K
;---------------- -------- -------- --------
;Total memory 66.112K ? 130.318K
;
IF (Exist("c:\temp\mem.txt") = 1)
del "c:\temp\mem.txt"
ENDIF
shell "%comspec% /c mem >c:\temp\mem.txt"
shell '%comspec% /c type c:\temp\mem.txt | find "Total memory" >c:\temp\memory.txt'
;
IF (Open(9,"c:\temp\memory.txt") = 0)
WHILE (@error = 0)
$result=ReadLine(9)
$pos=INSTR(LCASE($result), "total memory")
IF ($pos <> 0)
$memory=substr($result,41,len($result)-41)
ENDIF
LOOP
IF (CLOSE(9) <> 0)
ENDIF
ENDIF
ENDIF
IF (Exist("c:\temp\@wksta.txt") = 1)
del "c:\temp\"+@wksta.txt
ENDIF
IF (Exist("c:\temp\mem.txt") = 1)
del "c:\temp\mem.txt"
ENDIF
IF (Exist("c:\temp\memory.txt") = 1)
del "c:\temp\memory.txt"
ENDIF
;
? "Memory: "+$memory+" KBytes"
example encrypted file with compression:
code:
begin: (c) MCA - 2000 (2000159 wed 07-jun-2000 19:37:17)
кЊ͚ݖдɯ
Э땅ҫȅ̼˝ԯ߆
ޫݠؑߪދ˒
Ѱ˚㈎̷Ɉ
̆Ϥв˻сᡌˆћ䒆ߑŠ
ł̲˅Ԅ۲܁͉᷷曂Ȁ
ݟȊ՜찣ͥٲϡ
ʙ긔Ѕ؟̻佟Ѕݱ
ٍՈ̀Զɣ
end: completed.
end: crc16=59582
Original filesize 1937 bytes. result: 668 bytes.
example stripping kixtart script. by distributing this version it will not be possible to reconstruct the original file, which can contain comment and debug code.
code:
IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF $memory=0 IF ($NT_mode = "yes") IF (Exist("c:\temp\memory.txt") = 1) del "c:\temp\"+@wksta.txt ENDIF cd
"c:\temp" shell "%comspec% /c winmsd /s /f" shell '%comspec% /c type '+@wksta.txt+' | find " Total:" >c:\temp\memory.txt' IF (Open(9,"c:\temp\memory.txt") =
WHILE (@error = 0) $result=ReadLine(9) $pos=INSTR(LCASE($result), "total:") IF ($pos <> 0) $memory=substr($result,$pos+6,len($result)-$pos-1) ENDIF LOOP IF
(CLOSE(9) <> 0) ENDIF ENDIF ELSE IF (Exist("c:\temp\mem.txt") = 1) del "c:\temp\mem.txt" ENDIF shell "%comspec% /c mem >c:\temp\mem.txt" shell '%comspec% /c
type c:\temp\mem.txt | find "Total memory" >c:\temp\memory.txt' IF (Open(9,"c:\temp\memory.txt") = 0) WHILE (@error = 0) $result=ReadLine(9)
$pos=INSTR(LCASE($result), "total memory") IF ($pos <> 0) $memory=substr($result,41,len($result)-41) ENDIF LOOP IF (CLOSE(9) <> 0) ENDIF ENDIF ENDIF IF
(Exist("c:\temp\memory.txt") = 1) del "c:\temp\"+@wksta.txt ENDIF IF (Exist("c:\temp\mem.txt") = 1) del "c:\temp\mem.txt" ENDIF IF (Exist("c:\temp\memory.txt")
= 1) del "c:\temp\memory.txt" ENDIF
Very soon we will distributed the program for you. So you know at this moment: a program for protection of your scripts will become available with must of above techniques.
Of course not all techniques we are using we are describing in above list. You must never give all methods to a cracker.
Greetings.
BTW: next reply will contain the distribution information.