Classificação de Algoritmos Esteganográficos
3293 registros
0 hoje
12 nesta semana
29 neste mês![]() | 73% | Brasil (39615) |
![]() | 4% | Portugal (2436) |
![]() | 4% | EUA (1930) |
![]() | 0% | Holanda (237) |
![]() | 0% | Rússia (232) |
| Hoje: | 532 |
| Ontem: | 1993 |
| No mês: | 28774 |
| Mês passado: | 25815 |
| Total: | 54589 |
| Recorde: | 3037 |
| No dia: | 04.03.10 |
| Leituras hoje: | 12650 |
| Leituras Total: | 236764 |
| Bots hoje: | 204 |
| Dados desde: | 16.02.2010 |
| XTEA * |
|
|
|
| Escrito por vovó Vicki |
| Sex, 08.09.2006 20:38 |
|
Depois da descoberta de fragilidades no TEA, os autores sugeriram algumas modificações no algoritmo. O algoritmo XTEAO XTEA (extended TEA, algumas vezes chamado de "tean") foi a resposta dos autores do TEA, David Wheeler e Roger Needham, depois da descoberta de que ataques de Chaves Equivalentes e de Chaves Relacionadas comprometiam a segurança do TEA. O novo algoritmo apresentado tem a seguinte estrutura: ![]() 1 Ciclo do XTEA = 2 etapas Feistel O XTEA usa as mesmas operações básicas do TEA (XOR, adição módulo 232 e shifts), mas a ordenação é bem diferente. Para prevenir ataques baseados em chaves, as 4 sub-chaves são misturadas de uma forma menos regular e com uma frequência menor. A implementação do algoritmo continua sendo fácil. Desta vez vou citar um exemplo usando a linguagem de programação JavaScript: // use 16 chars of 'password' to encrypt 'plaintext' with xTEA function encrypt(plaintext, password) { var v = new Array(2), k = new Array(4), s = "", i; plaintext = escape(plaintext); // use escape() so only have single-byte chars to encode // build key directly from 1st 16 chars of password k[0] = Str4ToLong(password.slice(0,4)); k[1] = Str4ToLong(password.slice(4,8)); k[2] = Str4ToLong(password.slice(8,12)); k[3] = Str4ToLong(password.slice(12,16)); for (i=0; i<plaintext.length; i+=8) { // encode plaintext into s in 64-bit (8 char) blocks v[0] = Str4ToLong(plaintext.slice(i,i+4)); // ... note this is 'electronic codebook' mode v[1] = Str4ToLong(plaintext.slice(i+4,i+8)); code(v, k); s += LongToStr4(v[0]) + LongToStr4(v[1]); } return escCtrlCh(s); } // use 16 chars of 'password' to decrypt 'ciphertext' with xTEA function decrypt(ciphertext, password) { var v = new Array(2), k = new Array(4), s = "", i; k[0] = Str4ToLong(password.slice(0,4)); k[1] = Str4ToLong(password.slice(4,8)); k[2] = Str4ToLong(password.slice(8,12)); k[3] = Str4ToLong(password.slice(12,16)); ciphertext = unescCtrlCh(ciphertext); for (i=0; i<ciphertext.length; i+=8) { // decode ciphertext into s in 64-bit (8 char) blocks v[0] = Str4ToLong(ciphertext.slice(i,i+4)); v[1] = Str4ToLong(ciphertext.slice(i+4,i+8)); decode(v, k); s += LongToStr4(v[0]) + LongToStr4(v[1]); } // strip trailing null chars resulting from filling 4-char blocks: if (s.search(/\0/) != -1) s = s.slice(0, s.search(/\0/)); return unescape(s); } function code(v, k) { // Extended TEA: this is the 1997 revised version of Needham & Wheeler's algorithm // params: v[2] 64-bit value block; k[4] 128-bit key var y = v[0], z = v[1]; var delta = 0x9E3779B9, limit = delta*32, sum = 0; while (sum != limit) { y += (z<<4 ^ z>>>5)+z ^ sum+k[sum & 3]; sum += delta; z += (y<<4 ^ y>>>5)+y ^ sum+k[sum>>>11 & 3]; // note use of >>> in place of >> due to lack of 'unsigned' type in JavaScript } v[0] = y; v[1] = z; } function decode(v, k) { var y = v[0], z = v[1]; var delta = 0x9E3779B9, sum = delta*32; while (sum != 0) { z -= (y<<4 ^ y>>>5)+y ^ sum+k[sum>>>11 & 3]; sum -= delta; y -= (z<<4 ^ z>>>5)+z ^ sum+k[sum & 3]; } v[0] = y; v[1] = z; } // supporting functions function Str4ToLong(s) { // convert 4 chars of s to a numeric long var v = s.charCodeAt(0) + (s.charCodeAt(1)<<8) + (s.charCodeAt(2)<<16) + (s.charCodeAt(3)<<24); return isNaN(v) ? 0 : v; } function LongToStr4(v) { // convert a numeric long to 4 char string var s = String.fromCharCode(v & 0xFF, v>>8 & 0xFF, v>>16 & 0xFF, v>>24 & 0xFF); return s; } function escCtrlCh(str) { // escape control chars which might cause problems with encrypted texts return str.replace(/[\0\n\v\f\r!]/g, function(c) { return '!' + c.charCodeAt(0) + '!'; }); } function unescCtrlCh(str) { // unescape potentially problematic nulls and control characters return str.replace(/!\d\d?!/g, function(c) { return String.fromCharCode(c.slice(1,-1)); }); } XTEA em JavaScriptOs 128 bits (16 caracteres) da Senha são usados para cifrar o texto claro usando o XTEA de Wheeler e Needham. Confira a cifra Fontes
|
| Atualização Qua, 15.04.2009 13:20 |