Título: ¿cifrar en base64 como el script spoiler de identi y hackstore como se hace? Publicado por: Weeken en 4 Marzo 2013, 03:02 am ¿cifrar en base64 como el script spoiler de identi y hackstore como se hace?
Hola bueno no se si han visitado esas paginas pero me mola mucho esos sistemas de ultraproteccion de links en servidores free de descarga :P . solo buscando por internet encontre estos codigos. :xD Ejemplo 1 Código
Ejemplo 2 Código
Ejemplo 3 Código
puedes provar aqui http://www.lawebera.es/recursos/herramientas/probar_codigo_html.php algo asi seria en Blogger ,pero este se ve los links de descargas en el codigo fuente :-\ demo en Blogger http://prueba1256987.blogspot.com/2013/02/entrada-popup.html pero deberia quedar asi como el de identi y hackstore (SMF), que trabaja con un archivo php aparte del script para hacer la encriptacion en base64 http://foro-vip.com/1.php yo creo que con eso es mas dificil que denuncien los links rapidamente de descargas con Copyright los robots de Google DMCA LA SOPA y el FBI ;-) como se hace no la tengo clara :huh: es que no lo encuentro en google explicado :rolleyes: http://stackoverflow.com/questions/246801/how-can-you-encode-to-base64-using-javascript http://php.net/manual/es/function.base64-encode.php http://es.wikipedia.org/wiki/Base64 tambien se podria usar base64 en cnl2 http://jdownloader.org/knowledge/wiki/glossary/cnl2 buenisimos por jdownloader y Mipony imaginaos bajar 20 links cifrados con un clic este no requiere publicidad por cierto ;D por ultimo que otra encriptacion me recomiendan las mas potentes aparte de base64 :huh: :laugh: Saludos. Título: Re: ¿cifrar en base64 como el script spoiler de identi y hackstore como se hace? Publicado por: ~ en 4 Marzo 2013, 03:31 am Aquí tengo una muestra de codificación de Base64 en javascript con funciones personalizadas que yo escribí, para mostrar el algoritmo. Traducirla a PHP no debería ser difícil.
Muestra de Base64 en javascript (http://devel.cable-modem.org/snippets/javascript/_/Base64_muestra.html) Aunque también se puede usar atob (decodificar) o btoa (codificar) en javascript, o sus equivalentes de PHP. Este algoritmo que tengo aquí funciona para absolutamente cualquier valor, de texto o binario. También se mantiene dentro de estándar, por basarse en el algoritmo de Base64. Se podría usar Base64 para tener un nivel de seguridad mínimo, o tal vez casi intermedio, si se usa una tabla no estándar de caracteres. Normalmente los caracteres que usa Base64 son estos: Código: var Base64_chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; Pero si usamos otro orden y lo mantenemos secreto en todo momento, podría funcionar casi como una contraseña de 64 bytes (512 bits). Por ejemplo: Código: var Base64_nostd="9ryoAuwh4RvMDPYKNltWUTaEqnBmbcSZFxfGg7iJj6QsVkOXzdH0C1p2e35L8I+/="; Con las siguientes funciones que he escrito se puede "cifrar" y "descifrar" en Base64, usando una tabla no estándar: Código: /***************************************************************************** Base64: My_btoa y My_atob 2012-07-02 Implementación de Base64 en javascript. http://devel.cable-modem.org/ Este código es de dominio público (sin derechos de autor). Puedes hacer lo que desees con él. *****************************************************************************/ function My_atob(base64_data, table) { var binary64=""; var binary=""; if(typeof(base64_data)!="string")return ""; if(!(base64_data.length>0))return ""; var tmp=""; var c=""; for(var x=0;x<base64_data.length;x++) { c=base64_data.charAt(x); //These padding characters should be ignored: /// if(c=="=" || c==" " || c=="\t" || c=="\r" || c=="\n")continue; //Otherwise, look for the index in which the specified character is. //That will be the value of the Base64 current character. else c=table.indexOf(c); binary64+=StrPad(str=c.toString(2),padchar="0",paddedstrlen=6,direction="l"); if(binary64.length>=8) { binary+=String.fromCharCode(parseInt(binary64.substring(0,8),2)); binary64=binary64.substring(8,binary64.length); } } return binary; } //Converts a raw "binary" data string into Base64 data: /// function My_btoa(binary_data, table) { var Base64_TBL=table.split(""); //This will contain our resulting converted data /// var base64=""; //Check that the data is a string and that its length is not 0: /// if(typeof(binary_data)!="string")return ""; if(!(binary_data.length>0))return ""; //Temporary 32-bit DWORD: /// var tmp=""; //4-byte temporary Base64 chunk for each 3 bytes of data, and/or plus padding if necessary: /// var tm2=""; //Number of '=' padding characters, to avoid generating Base64 charactes that should be padding to begin with: //Number of '=' characters if there is no further data in size divisible exactly by 3: /// var padcount=""; //This loop advances in groups of 3 because 3 "binary" letters //produce 4 Base64 letters: /// for(var x=0;x<binary_data.length;x+=3) { //INIT: Read a DWORD safely byte by byte, with "memory boundary checking" //INIT: Read a DWORD safely byte by byte, with "memory boundary checking" //INIT: Read a DWORD safely byte by byte, with "memory boundary checking" //INIT: Read a DWORD safely byte by byte, with "memory boundary checking" /// tmp=binary_data.charCodeAt(x)<<24; //bits 31-24 if(x+1<binary_data.length) tmp|=binary_data.charCodeAt(x+1)<<16; //bits 23-16 else padcount++; //If there's no data, increase padding and this bit group is 0 automatically if(x+2<binary_data.length) tmp|=binary_data.charCodeAt(x+2)<<8; //bits 15-8 else padcount++; //If there's no data, increase padding and this bit group is 0 automatically //bits 7-0 are 0 always //END: Read a DWORD safely byte by byte, with "memory boundary checking" //END: Read a DWORD safely byte by byte, with "memory boundary checking" //END: Read a DWORD safely byte by byte, with "memory boundary checking" //END: Read a DWORD safely byte by byte, with "memory boundary checking" //Shift 8 bits left to re-align all bit values in an order //proper for the 6 bits of Base64. // //This will NOT discard the first 2 bits of the DWORD, but anyway //the bits of the next byte of data, if present (byte 4), //belong to the next group of 3 bytes and are useless for the //current 32-bit run: /// tmp>>=8; //tmp is a 32-bit DWORD here //"Flush" past, now useless data, before using the buffer again (might not be necessary //in C or assembly since the data in those languages will always be overwritten either by //data or padding; but it is required in javascript because the string cannot be handled //so freely in such language). /// tm2=""; var sshl=6; //I thought that this bit shifting was going to be dynamic, but after the adjusting above //and the bit masking below inside the loop, it isn't necessary at all. for(var y=0;y<4;y++) { //Get bits 31-24, then 23-16 and 15-8 and use them as index for the third, second //and first Base64 characters, respectively: /// //Save the corresponding Base64 character, backwards, or if we are in a range in which //we previously detected that there was no data available for bytes 2 of 3 and/or 3 of 3, //just add padding. // //In other words, if the count of required padding characters is 0 (3 original bytes were //present for this loop run), or if the count of padding characters is not 0 and y is //in a range above/outside that of the padding characters to generate, then save a Base64 //indexed character. // //Otherwise, we are in a byte range for padding, and we must generate and save a padding character //(it could and should only happen at the very end of the whole data buffer): /// if(padcount==0 || (padcount!=0 && y>padcount-1)) { tm2=Base64_TBL[tmp&63]+tm2; } else tm2=tm2+"="; //Keep shifting bits. We have saved backwards because in this way we //reduce the amount of bit shifting and bit masking required to get //the 6 bits required for each Base64 character, and still we can get //each Base64 character as soon as possible, as soon as its offset //is available to us. /// tmp>>=6; } //Save this chunk of Base64 characters: /// base64+=tm2; } return base64; } function StrPad(str,padchar,paddedstrlen,direction) { //If no direction was specified, the default action is //to pad leftmost: /// if(!direction)direction="l"; //Don't allow empty padding character variable or a bad final padded length //because it would cause an infinite loop: /// if(typeof(paddedstrlen)!="number" || typeof(padchar)!="string")return str; if(!(padchar.length>0) || paddedstrlen<=0)return str; if(direction.toLowerCase()=="r") { while(str.length<paddedstrlen) { str=str+padchar.charAt(0); } } else { while(str.length<paddedstrlen) { str=padchar.charAt(0)+str; } } return str; } Para cifrar: var encrypt=My_btoa("Hola123456", Base64_nostd) El resultado es: twIVqWAHD0N1PF== My_atob(encrypt, Base64_nostd) El resultado es de vuelta: Hola123456 Recordemos que se usó la tabla no estándar de caracteres. Si alguien trata de descifrar esto sin ver o recordar la tabla que se usó, se dará cuenta que es extremadamente difícil de descifrar. La seguridad, siempre y cuando se mantenga secreta la tabla no estándar de Base64, se puede aumentar considerablemente si se cifra la cadena cifrada sobre sí misma un mínimo de 4 veces, y un número aleatorio de veces mayor a 4. Título: Re: ¿cifrar en base64 como el script spoiler de identi y hackstore como se hace? Publicado por: Weeken en 4 Marzo 2013, 03:43 am gracias por el ejemplo.
|