Aqui está a prova da resposta de nixda
:
Eu uso rar v4 e unrar v4.10 no Linux.
Eu escrevi um código em C para testar o tamanho da senha:
int main(void){
char password[150];
int i=0, j =0;
int r;
for (i=0; i<150 ; i++){
r = rand()%10;
password[i]= (char)(((int)'0')+r);
}
char command[300] = {'Extracting from hi.rar
Extracting hi.txt 40%
CRC failed in the encrypted file hi.txt. Corrupt file or wrong password.
Total errors: 1
i: 124
password length: 124
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt 40%
CRC failed in the encrypted file hi.txt. Corrupt file or wrong password.
Total errors: 1
i: 125
password length: 125
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 126
password length: 126
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 127
password length: 127
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 128
password length: 128
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 129
password length: 129
'};
sprintf(command, " rar a -p[%s] hi.rar hi.txt",password);
printf("password: %s\n", command);
system(command);
usleep(50000);
char newcommand[300] = {'int main(void){
char password[150];
int i=0, j =0;
int r;
for (i=0; i<150 ; i++){
r = rand()%10;
password[i]= (char)(((int)'0')+r);
}
char command[300] = {'Extracting from hi.rar
Extracting hi.txt 40%
CRC failed in the encrypted file hi.txt. Corrupt file or wrong password.
Total errors: 1
i: 124
password length: 124
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt 40%
CRC failed in the encrypted file hi.txt. Corrupt file or wrong password.
Total errors: 1
i: 125
password length: 125
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 126
password length: 126
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 127
password length: 127
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 128
password length: 128
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal
Extracting from hi.rar
Extracting hi.txt OK
All OK
i: 129
password length: 129
'};
sprintf(command, " rar a -p[%s] hi.rar hi.txt",password);
printf("password: %s\n", command);
system(command);
usleep(50000);
char newcommand[300] = {'%pre%'};
char newpassword[150] = {'%pre%'};
for (i= 0 ; i < 301; i++){
for(j=0; j<i; j++){
newpassword[j] = password[j];
}
sprintf(newcommand, " unrar e -p[%s] -o+ hi.rar",newpassword);
if (system(newcommand) >= 0 ){
printf("i: %d\n",i);
printf("password length: %d\n", strlen(newpassword));
// break;
}
strcpy(newpassword, "0");
usleep(500000);
}
return 0;
}
'};
char newpassword[150] = {'%pre%'};
for (i= 0 ; i < 301; i++){
for(j=0; j<i; j++){
newpassword[j] = password[j];
}
sprintf(newcommand, " unrar e -p[%s] -o+ hi.rar",newpassword);
if (system(newcommand) >= 0 ){
printf("i: %d\n",i);
printf("password length: %d\n", strlen(newpassword));
// break;
}
strcpy(newpassword, "0");
usleep(500000);
}
return 0;
}
Ele cria uma senha numérica (0 a 9) numérica de 150 caracteres, gerada aleatoriamente, depois compacta um arquivo de exemplo (neste caso, hi.txt). Na segunda parte do código, ele tenta descompactar com a senha gerada anteriormente do 1º caractere para o caractere 150. Eu adicionei usleep
para poder monitorar as saídas (ou você pode usar apenas script
no linux para salvar as saídas e depois lê-las).
O que eu tenho é que ele foi capaz de descompactar o arquivo criptografado no 126º índice e, depois de tudo, o que significa que ele trunca a senha após o 127º caractere (observe que o índice começou em 0
).