Page 1 of 1 1
Topic Options
#50295 - 2000-06-20 07:48 PM New: Kixtart COMPRESSION + ENCRYPT/DECRYPT facility
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
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:


  1. an user can not modify the code.
  2. decryption must be run very fast.
  3. cracking of code must be very hard.

Explanation:


  1. 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.
  2. 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.
  3. 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.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#50296 - 2000-06-20 09:19 PM Re: New: Kixtart COMPRESSION + ENCRYPT/DECRYPT facility
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

There a two programs. The first one can be used for compression and decompression.
You can find it at:

home.wanadoo.nl/scripting/download/compress.exe

The other program do the encrypt/decrypt function.
You can find it at:

home.wanadoo.nl/scripting/download/codec.exe

After execution you will see only a date/time message.

tue 20-jun-2000 20:29:17 week 25 day 172

With "?" you see the options of both programs.

Possible procedure:


  • set personal=scripting@wanadoo.nl - 2000
  • compress /e test.kix test.tmp
  • codec /e test.tmp test.run /license=personal
  • set personal=

copy "test.run" to any location you like. f.e. "c:\winnt\test.run".
and your kixtart program is f.e. situated at "c:\winnt" directory.


  • if not exist c:\temp\nul mkdir c:\temp
  • codec /d c:\winnt\test.run c:\temp\test.tmp
  • compress /d c:\temp\test.tmp c:\temp\test.kix
  • c:\winnt\kix32.exe c:\temp\test.kix
  • del c:\temp\test.tmp
  • del c:\temp\test.kix

Possible special options of codec.exe


  • /Info shows information to screen
    during encryption some information is written to user screen.
    during decryption you only see messages.
  • /License add personal license text
    add a personal text to the file. program will ask for a value when you enter only "/License".
    by using a variable you can automate it.
  • /License=[var] use "[var]", "license" or ask-for-it value
  • /NoInfo no information to screen
  • /NoLicense no personal license text
  • /NoSecure only UUENCODE/UUDECODE run
    after encryption of text with this option. you always gets the same result.
  • /Secure full encryption
    different kinds of encryption are used for the file. so it use block, iterated block, feistel
    cipher and quantum cryptography. methodes used must prevent an almost statistically uniform
    distribution of characters. after encryption of text you never gets the same result.

default options: /Info /NoLicense /Secure

remarks:


  • use only 8.3 filenames
  • during run: no full file check is taking place. automatically it will overwrites the output file.
  • /encode can be truncated to /e
  • /decode can be truncated to /d

Example:

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 of code with default option /secure:

code:

begin (c) CODEC 1.29e (2000172 tue 20-jun-2000 19:50:50.99)
;
; (c) scripting@wanadoo.nl - 2000
;
; The software product is protected by copyright laws and
; international copyright treaties, as well as other in-
; tellectual property laws and treaties.
; The SOFTWARE PRODUCT is licensed, not sold.
;
; If you want to use the software for any (new) purpose
; you needs a license agreement, which can only be deli-
; vered by creator and owner of this software.
;
begin. size=369
Ƭȳ陟۫Ȱܚ篮םӋ<
ƷŤ㻞Ɉ衤<
㵩̲ңϣ݃±إ܀٣Τڪฒ<
ĨޞƼ⬃ߝܔƒɤޕڲẁǫ<
൛†Ìզǚź<
钲Ⳃ߂ؑҎٱ΍ɕ߾巕<
ƬȠ̪Ƴ鉻<
Փۻ۽禓۟ȨŐ⊊ܧ‑<
Ѹ<
end: completed.
end: check=

Example of code without default option secure. use option /NoSecure:

code:

begin (c) CODEC 1.29e (2000172 tue 20-jun-2000 19:51:29.77)
;
; (c) scripting@wanadoo.nl - 2000
;
; The software product is protected by copyright laws and
; international copyright treaties, as well as other in-
; tellectual property laws and treaties.
; The SOFTWARE PRODUCT is licensed, not sold.
;
; If you want to use the software for any (new) purpose
; you needs a license agreement, which can only be deli-
; vered by creator and owner of this software.
;
begin.. size=369
M.@(``./F<MBZS:>_:X77ZODW-[VNEV]U&`BP!?^UO^'P:KNKL\_FU;[>4T^V
M$L:*)L8^#Z?&JR_?R``/V_Z@A_)J?^`#@3K_K*B@J!&@R(\P_W`KXS^9BG\M
M\Z%B'XFYR5!E^G;V["TO#4P7'<1TE"4$C* W$UUX;:3W#R63):TJ6R0.2`E
M0E+8.S4&Q.RZRAA4)A*C1TPFFXC#A!6Z><??N+FB\=9WNB'<23'0\-:6-.-;
M]]%\0%`9O@@A`07SV*3(L^'X&OKPJI2K$Q8?F<BD/G8!A\SPI\_0(\H'`I8V
M&P$>(<?2+*(ST0T\`+W(,(]O*C>9).&P.LD!USSOY`3`51XA]\[P,WQF]Z(I
M[X_>K<_Y@<S#[;M<M2)9>=%[_U5WPSOD^9UV@D![IUI5YO8!_C"VV]R$4XRZ
MO?G11=$@UDY;0'0[;G':LTX)W\]')K8%Y]7MLJ9*!9E2KV^4$4\\.JG!5)\-
);6ZK8=K=8L\@
end: completed.
end: check=???? ????

Some benchmarks on Pentium 200 MHz


  • script 1: 8618 lines / 282.643 bytes
    compress /e = 5.60 sec 42.807 bytes
    codec /e = 0.38 sec 62.395 bytes
    codec /d = 0.66 sec
    compress /d = 0.72 sec
  • script 2: 4126 lines / 149.988 bytes
    compress /e = 5.60 sec 23.823 bytes
    codec /e = 0.38 sec 33.914 bytes
    codec /d = 0.66 sec
    compress /d = 0.72 sec

An extension in the furture is:


  • impossiblity to get the original source code,
    because a lot of action will take place on the original one. f.e.
    - changes to variable-names,
    - delete comment statements,
    - delete print-statements (is optional),
    - combine lines,
    - remove debug statements.
    Reduction of 50% of filesize is possible.
  • full check of filenames.
  • creation of a shell, which can activated compress and codec,
    which can not be traced by an user. so you can place the kixtart files + programs anywhere on your system. on a
    safe place.
  • creation of a facility to personalize the codec program.

Every reaction is welcome. Sometime a new version will be distributed at same URL's.
For solving a problem you must save the input-file. So you can check of a new version
fix the problem.
Greetings.

[This message has been edited by MCA (edited 20 June 2000).]

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#50297 - 2000-06-21 01:46 AM Re: New: Kixtart COMPRESSION + ENCRYPT/DECRYPT facility
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

A new version of CODEC is created. This version isn't compatible with previous one.
In the furture the program will be always compatible with published versions.
The new version generates more user information to the screen and CRC calculation has been speedup.
Important is:


  • after discovery of changes to file the output file will be automatically cleanup. So the code will not be available.
  • the program can not be terminated by a CTRL-BREAK command.

Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#50298 - 2000-06-21 08:36 PM Re: New: Kixtart COMPRESSION + ENCRYPT/DECRYPT facility
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

You can use also another compression tool. For example: ARJ.
Script looks like:

code:

arj a -jm1 -m2 kixtools.arj test.kix
set license=scripting@wanadoo.nl - 2000
codec /e kixtools.arj kixtools.sec
set license=

code:

codec /d kixtools.sec kixtools.arj
arj e kixtools.arj test.kix
kix32 test.kix

------------------
greetings

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 820 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.056 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org