Christoph Zurnieden: quelltext verschlüsseln?!

Beitrag lesen

Hi,

gibt es eine wirklich effektive methode seinen quellcode zu verschlüsseln?

Abba seffaständlich!

  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>  
<head>  
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">  
<title>Verschl&uuml;sselung mit Javascript</title>  
<!--  
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message  
 * Digest Algorithm, as defined in RFC 1321.  
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.  
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet  
 * Distributed under the BSD License  
 * See http://pajhome.org.uk/crypt/md5 for more info.  
-->  
<script type="text/javascript" src="md5-rfc1321.js"></script>  
  
<!--  
 * A JavaScript implementation of the Secure Hash Standard  
 * Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/  
 * Distributed under the BSD License  
 * Some bits taken from Paul Johnston's SHA-1 implementation  
 *  
-->  
<!--  
&gt;script type="text/javascript" src="sha2-256.js">&gt;/script>  
-->  
<!--  
  Or any other kind of function able to map input to sth  
  usefull to be put in a Javascript string directly.  
  The one I used was the table based base64 implementation  
  of Masanao Izumo <mo@goice.co.jp> at  
  http://www.onicos.com/staff/iz/amuse/javascript/expert/base64.txt  
-->  
<script type="text/javascript" src="MISC-JAVSCRIPT/base64.js"></script>  
  
<script type="text/javascript">  
//<!--  
/*  
  Several global variables.  
*/  
javascriptHeader =  
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\  
<html><head><meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">\  
<title>Do not forget to place your title here or it will end quite\  
embarassing for you</title>';  
  
javascriptDecryptionPartOne =  
'<script type="text/javascript" src="md5-rfc1321.js"></script>\  
<script type="text/javascript" src="MISC-JAVSCRIPT/base64.js"></script>\  
<script type="text/javascript">\  
function MD5(s){return core_md5(str2binl(s),s.length*chrsz);}\  
function decryptXtea(message,md5Key){var m=new Array(2);message=decodeBase64(message);\  
var len=message.length;var result="";for(var i=0;i<len;i=i+8){m[0]^= 0x00000000;\  
m[1]^=0x00000000;var sum=0xC6EF3720;var delta=0x9E3779B9;m[0]=message.charCodeAt(i);\  
m[0]|=message.charCodeAt(i+1)<<8;m[0]|=message.charCodeAt(i+2)<<16;\  
m[0]|=message.charCodeAt(i+3)<<24;m[1]=message.charCodeAt(i+4);\  
m[1]|=message.charCodeAt(i+5)<<8;m[1]|=message.charCodeAt(i+6)<<16;\  
m[1]|=message.charCodeAt(i+7)<<24;m[0]=m[0]&0xFFFFFFFF;m[1]=m[1]&0xFFFFFFFF;\  
for(var j=0;j<32;j++){m[1]-=(((m[0]<<4^m[0]>>5)+m[0])^(sum+md5Key[sum>>11&3])\  
)&0xFFFFFFFF;sum=(sum-delta)&0xFFFFFFFF;m[0]-=(((m[1]<<4^m[1]>>5)+m[1])\  
^(sum+md5Key[sum&3]))&0xFFFFFFFF;}result+=String.fromCharCode(((m[0]&0x000000FF))&0xFF);\  
result+=String.fromCharCode(((m[0]&0x0000FF00)>>8)&0xFF);result+=String.fromCharCode\  
(((m[0]&0x00FF0000)>>16)&0xFF);result+=String.fromCharCode(((m[0]&0xFF000000)>>24)\  
&0xFF);result+=String.fromCharCode(((m[1]&0x000000FF))&0xFF);result+=\  
String.fromCharCode(((m[1]&0x0000FF00)>>8)&0xFF);result+=String.fromCharCode(((m[1]\  
&0x00FF0000)>>16)&0xFF);result+=String.fromCharCode(((m[1]&0xFF000000)>>24)&0xFF);}\  
return result;}\  
function formSubmit(user, pass){\  
var md5key = MD5(pass);\  
document.write(decryptXtea("';  
  
javascriptDecryptionPartTwo =  
'",md5key));document.close();}\  
</script></head><form id="encryptformular" name="encryptformular"\  
onsubmit="formSubmit(this.form.username.value,this.form.password.value);\  
return false">Benutzername (wird hier nicht benutzt):<br><input name="username" id="username" type="text" size="50"\  
maxlength="50" /><br>Passwort:<br><input name="password" id="password"\  
type="password" size="50" maxlength="50" /><br><input name="decryptbutton"\  
id="decryptbutton" type="button" value="Decrypt" onclick=\  
"formSubmit(this.form.username.value,this.form.password.value);return false"/></form>\  
</html>';  
//-->  
/*  
  There exists another MD5-implementation by Henri Torgemane  
  and Ralf Mieke, which uses the "original" namespace from  
  RFC 1321. But that implementation reduces the input to ASCII  
  without obvious need and reason.  
  Just comment the wrapper underneath out if you have to  
  use that implementation.  
*/  
  
function MD5(s){  
  return core_md5(str2binl(s), s.length * chrsz);  
}  
  
/*  
  We use the MD5-algorithm as a simple hashfunktion.  
  MD5 as a cryptographical hashfunction must be considered  
  broken today, so many will doubt the innocence of  
  MD5 if used as a simple hashfunction only. There is an  
  implementation of SHA2(256) in Javascript available at  
  http://anmar.eu.org/projects/jssha2/ (3-C-BSD-Licence)  
  
  Reducing the 32 bytes to 16 bytes is done quite simply  
  by XORing the first 16 bytes wih the second 16 bytes.  
  
  Not yet tested, just written down.  
  
function MD5(s){  
  
  var hash = new Array(8);  
  var ret  = new Array(4);  
  
  hash = core_sha256(str2binb(s),s.length * chrsz);  
  for(var i=0;i<4;i++){  
    ret[i] = ((hash[i]&0xFFFFFFFF)^(hash[7-i]&0xFFFFFFFF))&0xFFFFFFFF;  
  }  
  
  return ret;  
}  
  
*/  
  
/*  
  The additional data for the HMAC would be  
  the username in this case. Not used here  
  it's just a suggestion.  
  
function HMAC_MD5(s,t){  
  return core_hmac_md5(s, t);  
}  
*/  
  
/*  
  The XTEA algorithm used here is based on the first  
  example of the modification of Needham/Wheeler  
  published in "Tea extensions" (1996-97).  
*/  
function encryptXtea(message,md5Key){  
  /*  
    for comments see decryptXtea()  
    underneath.  
  */  
  var m      = new Array(2);  
  
  var len    = message.length;  
  var result = "";  
  
  for(var i=0; i < len; i = i+8){  
    m[0] ^= 0x00000000;  
    m[1] ^= 0x00000000;  
  
    var sum    = 0x0;  
    var delta  = 0x9E3779B9;  
  
    m[0]  = message.charCodeAt(i);  
    m[0] |= message.charCodeAt(i+1) << 8;  
    m[0] |= message.charCodeAt(i+2) << 16;  
    m[0] |= message.charCodeAt(i+3) << 24;  
    m[1]  = message.charCodeAt(i+4);  
    m[1] |= message.charCodeAt(i+5) << 8;  
    m[1] |= message.charCodeAt(i+6) << 16;  
    m[1] |= message.charCodeAt(i+7) << 24;  
  
  
    m[0] = m[0] & 0xFFFFFFFF;  
    m[1] = m[1] & 0xFFFFFFFF;  
  
    for(var j = 0; j < 32; j++){  
      m[0] += (  ((m[1]<<4 ^ m[1]>>5) + m[1])  
                ^ (sum + md5Key[sum & 3])  
              ) & 0xFFFFFFFF;  
  
      sum = (sum + delta) & 0xFFFFFFFF;  
  
      m[1] += ( ((m[0]<<4 ^ m[0]>>5) + m[0])  
               ^ (sum + md5Key[sum>>11 & 3])  
       ) & 0xFFFFFFFF;  
    }  
    result += String.fromCharCode((m[0]&0x000000FF));  
    result += String.fromCharCode((m[0]&0x0000FF00) >>  8);  
    result += String.fromCharCode((m[0]&0x00FF0000) >> 16);  
    result += String.fromCharCode((m[0]&0xFF000000) >> 24);  
    result += String.fromCharCode((m[1]&0x000000FF));  
    result += String.fromCharCode((m[1]&0x0000FF00) >>  8);  
    result += String.fromCharCode((m[1]&0x00FF0000) >> 16);  
    result += String.fromCharCode((m[1]&0xFF000000) >> 24);  
  }  
  return encodeBase64(result);  
}  
  

Der fehlende Rest steht im nächstem Posting.

so short

Christoph Zurnieden