Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Šta ovo radi ?

[es] :: C programiranje :: Šta ovo radi ?

[ Pregleda: 1942 | Odgovora: 11 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

StratOS
Slovenija

Član broj: 2234
Poruke: 983
*.dsl.siol.net



Profil

icon Šta ovo radi ?07.05.2002. u 07:12

Evo jednog source koda za enkripciju fajla:
Ja bih točno trebao znati što on radi jer se baš ne poznajem s tim.
Svaki koment posamičnog reda bi dobro došao, a što me najbolje zanima je algoritam ove enkripcije.

Code:

/* my l33t 3ncrypt10n pr0gr4m - K4v1n.
*/
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <process.h>
#include <io.h>
#include <sysstat.h>

unsigned char buffer[1024],state[256],x,y;
int infile,
    outfile,
    len;
char *pwd;

void init_crypt(char *keydata)
{ unsigned int i,keylen;
  unsigned char index1,index2;
  char newpass[100];
  x=0;
  y=0;
  keylen=strlen(keydata);
  printf("Key:%s, Length:%d",keydata,strlen(keydata));
  strcpy(newpass,"H4ck3d4ndCr4ck3d");
  strcat(newpass,keydata);
  for(i=0;i<256;i++)
    state[ i ]=(unsigned char)(i*73);
  index1=0;
  index2=0;
  for(i=0;i<256;i++)
  { index2+=keydata[index1]+state[ i ];
    x=state[index2];
    state[index2]=state[ i ];
    state[ i ]=x;
    index1=(index1+1)%keylen;
  }
  x=0;
}

void process_string(unsigned char *inoutstring,unsigned int length)
{ unsigned char a,b;
  while(length--)
  { a=state[++x];
    y+=a;
    b=state[y];
    state[y]=a;
    a+=b;
    state[x]=b;
    (*inoutstring++)^=state[a];
  }
}

void main(int argc,char *argv[])
{ if(argc!=4)
  { printf("Usage : encrypt <infile> <outfile> <password>n");
    exit(1);
  }
  if ((infile=open(argv[1],O_BINARY))==-1)
  { printf("Can't Open : %sn",argv[1]);
    exit(1);
  }
  if((outfile=open(argv[2],O_WRONLY|O_CREAT|O_BINARY,S_IWRITE))==-1)
  { printf("Can't Open : %sn",argv[2]);
    exit(1);
  }
  pwd=argv[3];
  init_crypt(pwd);
  for(;;)
  { if((len=read(infile,buffer,1024))==0)break;
    process_string(buffer,len);
    write(outfile,buffer,len);
  }
  close(outfile);
  close(infile);
}



poz Boris
Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
07.05.2002. u 07:12 

leka
Dejan Lekić
senior software engineer, 3Developers Ltd.
London, UK

Član broj: 234
Poruke: 2530
*.racasse.se

Sajt: dejan.lekic.org


Profil

icon Re: Šta ovo radi ?08.05.2002. u 18:42
Poprilicno losa kriptografija koliko mogu da vidim na prvi pogled.
Dejan Lekic
software engineer, MySQL/PgSQL DBA, sysadmin
08.05.2002. u 18:42 

StratOS
Slovenija

Član broj: 2234
Poruke: 983
*.dsl.siol.net



Profil

icon Re: Šta ovo radi ?09.05.2002. u 07:24
Da, ali je fora u tom, da treba riješiti ovaj primjer Da ovo.

Može malo detalnije o ovom programu ?
Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
09.05.2002. u 07:24 

01011011
Nikola Ivetić
CHICAGO, USA

Član broj: 561
Poruke: 2341
67.241.69.*

ICQ: 45747235
Sajt: www.memorizeme.net


Profil

icon Re: Šta ovo radi ?09.05.2002. u 08:30
Gde si nasao Source Code za ovo???
09.05.2002. u 08:30 

StratOS
Slovenija

Član broj: 2234
Poruke: 983
*.dsl.siol.net



Profil

icon Re: Šta ovo radi ?19.02.2003. u 14:46
You must find what is in the pcx file.

You must let us know the answer it contains.

Unfortunately it came from the hard drive of Kevin, the hacker of Midas. Kevin is refusing to cooperate with us, but we don't believe that he is needed as we think we have everything necessary to solve this little annoyance.

We found the source code to Kevins encryption program, as well as the program itself. The only thing we don't know is the password.

Our analysts tell us that they suspect Kevin would use an easy to remember password but they suspect that he would use some kind of hacker speak alteration to make it difficult for us. We want you to investigate and solve the problem for us. Good luck.


Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
19.02.2003. u 14:46 

genye

Član broj: 8392
Poruke: 6
195.178.47.*



Profil

icon Re: Šta ovo radi ?24.02.2003. u 10:49
"HACK AND CRACK"

4= "A"
3d = "space"

hah...


24.02.2003. u 10:49 

Rapaic Rajko
programer, Grappolo
Bgd

Član broj: 4105
Poruke: 413
*.pexim.co.yu



Profil

icon Re: Šta ovo radi ?24.02.2003. u 11:31
Wow!...

Svaka cast.

Rajko
24.02.2003. u 11:31 

StratOS
Slovenija

Član broj: 2234
Poruke: 983
*.ce.sik.si



Profil

icon Re: Šta ovo radi ?25.02.2003. u 07:29
Not valid pcx ?
Dali je to uopste graphic file ?

C:\1>encrypt pwd.pcx 1.pcx "HACK AND CRACK"
Key:HACK AND CRACK, Length:14
C:\1>

Dali treba još transformacija ("H4ck3d4ndCr4ck3d") to elleet ?

pa ni "Hack and crack " ne odgovara
C:\1>encrypt pwd.pcx 2.pcx "Hack and crack "
Key:Hack and crack , Length:15
C:\1>

Probat cu sa dictionary brute-force ellite i pregledom pcx headera.
Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
25.02.2003. u 07:29 

genye

Član broj: 8392
Poruke: 6
195.178.47.*



Profil

icon Re: Šta ovo radi ?25.02.2003. u 10:09
probaj sa drugim delimiterima
3D u ASCII tabeli je "="
25.02.2003. u 10:09 

StratOS
Slovenija

Član broj: 2234
Poruke: 983
*.ce.sik.si



Profil

icon Re: Šta ovo radi ?26.02.2003. u 07:49
Da mislim da je stvarno nesto oko elite abecede i onog startnog stringa, sada probavam sa brute forceom (elite dictionary).
4=A
7=T
3=E
...

No poslje treba deenkriptirati taj pcx i pregledati dali su headeri onog pcx-a stvarno pravilni headeri (dali je to graficka slika), kad upotrebljavam elite mislim da ce se headeri umalo poklopiti sa headerom kod pcx formata i izdati konacno rjesenje.
Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
26.02.2003. u 07:49 

genye

Član broj: 8392
Poruke: 6
195.178.47.*



Profil

icon Re: Šta ovo radi ?27.02.2003. u 14:28
Ovde se najvrovatinije radi o nekoj vrsti "public key" enkripcije (RSA) pri cemu je javni deo kljuca string "H4ck3d4ndCr4ck3d" u kombinaciji sa password-om u komandnoj liniji. Za primarni broj se koristi niz od 256 elemenata u formi a=i*73
73 je ovde taj prost broj (mali u odnosu na RSA koji ima 129 cifara RSA129)
Dekripcija ovakvog koda bi se svela na odredjivanje celog kljuca i "brute force" napadom na string iz komandne linije. Ceo kljuc bi mogao se dobiti na po osnovu dekripcionog algoritma za RSA.

Ko je razumeo razumeo je..... ja nisam skroz:))) ali to je to...
27.02.2003. u 14:28 

StratOS
Slovenija

Član broj: 2234
Poruke: 983
*.dsl.siol.net



Profil

icon Re: Šta ovo radi ?23.09.2003. u 22:11
Evo, jedan mi je malo pomogao, no nece da da keyword ...

1.)dictionary attack
-Ddecodirao je sa pogođenim keywordom, pcx slika treba da bude prava pcx (bytes 80 to 127 = 0)

Help :
Prvo je probao sa svima slovima u dictionary-u, a poslje je zamenio slova sa brojevima (3=e, 4=a, 0=o), dokle nije dosao do rjesenja.

Ima tko dobar dictionary ?
... Josh mi nije uspjelo.
Pozdrav StratOS
"Multitasking - ability to f##k up several things at once."
"It works better if you plug it in."
"As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications."
"The one who is digging the hole for the other to fall in is allready in it."
23.09.2003. u 22:11 

[es] :: C programiranje :: Šta ovo radi ?

[ Pregleda: 1942 | Odgovora: 11 ]

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.