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

Šta ovo radi ?

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

[ Pregleda: 4259 | Odgovora: 11 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

StratOS
Slovenija

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



+1 Profil

icon Šta ovo radi ?07.05.2002. u 07:12 - pre 238 meseci
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."
 
Odgovor na temu

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

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

Sajt: dejan.lekic.org


+2 Profil

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

StratOS
Slovenija

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



+1 Profil

icon Re: Šta ovo radi ?09.05.2002. u 07:24 - pre 238 meseci
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."
 
Odgovor na temu

01011011
Avanade
CHICAGO, USA

Član broj: 561
Poruke: 2341
67.241.69.*

ICQ: 45747235
Sajt: www.snailtrail.net


+2 Profil

icon Re: Šta ovo radi ?09.05.2002. u 08:30 - pre 238 meseci
Gde si nasao Source Code za ovo???
 
Odgovor na temu

StratOS
Slovenija

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



+1 Profil

icon Re: Šta ovo radi ?19.02.2003. u 14:46 - pre 228 meseci
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."
 
Odgovor na temu

genye

Član broj: 8392
Poruke: 6
195.178.47.*



Profil

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

4= "A"
3d = "space"

hah...


 
Odgovor na temu

Rapaic Rajko
Bgd

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



+62 Profil

icon Re: Šta ovo radi ?24.02.2003. u 11:31 - pre 228 meseci
Wow!...

Svaka cast.

Rajko
 
Odgovor na temu

StratOS
Slovenija

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



+1 Profil

icon Re: Šta ovo radi ?25.02.2003. u 07:29 - pre 228 meseci
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."
 
Odgovor na temu

genye

Član broj: 8392
Poruke: 6
195.178.47.*



Profil

icon Re: Šta ovo radi ?25.02.2003. u 10:09 - pre 228 meseci
probaj sa drugim delimiterima
3D u ASCII tabeli je "="
 
Odgovor na temu

StratOS
Slovenija

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



+1 Profil

icon Re: Šta ovo radi ?26.02.2003. u 07:49 - pre 228 meseci
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."
 
Odgovor na temu

genye

Član broj: 8392
Poruke: 6
195.178.47.*



Profil

icon Re: Šta ovo radi ?27.02.2003. u 14:28 - pre 228 meseci
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...
 
Odgovor na temu

StratOS
Slovenija

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



+1 Profil

icon Re: Šta ovo radi ?23.09.2003. u 22:11 - pre 221 meseci
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."
 
Odgovor na temu

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

[ Pregleda: 4259 | Odgovora: 11 ] > FB > Twit

Postavi temu Odgovori

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