Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - sdfg

Pages: [1]
1
General Programming / Range of hardware breakpoints
« on: November 08, 2008, 06:10:46 pm »
Is there any way to set execute hardware breakpoints for every instruction in a certain range of memory in ollydbg?

2
General Discussion / Yoga
« on: September 05, 2008, 12:17:14 pm »
Does anybody here do it?
I'm seriously considering yoga. Not that my life is hectic or anything, I think it'd be errm... a great way to relax. I think I have some kind of stress disorder. It seems every time I seriously try to let go, I instead just tense up more, especially in the throat.

I'm not sure if this was the proper board for this topic, but oh well! you guys should look into one for kinesiology discussion.

3
Botdev / SRP proof?
« on: August 30, 2008, 02:20:42 am »
Hello, my implementation of SRP always seems to fail on the password proof, can anyone see what the problem is? I don't really have anything to test my values against, so i'm completely lost as to where the screwup originates.
Code: [Select]
static unsigned char N_raw[32] = {0x87, 0xc7, 0x23, 0x85, 0x65, 0xf6, 0x16, 0x12,
    0xd9, 0x12, 0x32, 0xc7, 0x78, 0x6c, 0x97, 0x7e,
      0x55, 0xb5, 0x92, 0xa0, 0x8c, 0xb6, 0x86, 0x21,
  0x03, 0x18, 0x99, 0x61, 0x8b, 0x1a, 0xff, 0xf8};
   

static unsigned char I_raw[20] = {0x6c, 0x0E, 0x97, 0xED,
      0x0A, 0xF9, 0x6B, 0xAB,
      0xB1, 0x58, 0x89, 0xEB,
  0x8B, 0xBA, 0x25, 0xA4,
  0xF0, 0x8C, 0x01, 0xF8};

char usernamehash[20];
char usernpasshash[20];
BigBuffer g;
BigBuffer n;
BigBuffer a;
BigBuffer A;
char A_raw[32];
int userlen, passlen;

char a_tmp[32] = {
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1
};

void SRPInit(char *user, char *pass) {
char asdf[128];
userlen = strlen(user);
passlen = strlen(pass);
ucasecpy(asdf, user);
asdf[userlen] = ':';
ucasecpy(asdf + userlen + 1, pass);
SHA1(asdf, userlen + 1 + passlen, usernpasshash);
ucasecpy(asdf, user);
SHA1(asdf, userlen, usernamehash);
storm.SBigNew(&n);
storm.SBigNew(&a);
storm.SBigNew(&g);
storm.SBigFromBinary(n, N_raw, 32);
storm.SBigFromBinary(a, a_tmp, 32);
storm.SBigFromUnsigned(g, 0x2F);
}

void SRPCalculateA(char *outbuf) {
unsigned long len = 32;
storm.SBigNew(&A);
storm.SBigPowMod(A, g, a, n);
storm.SBigToBinaryBuffer(A, A_raw, len, &len);
memcpy(outbuf, A_raw, 32);
}

void SRPCalculateM1(char *outbuf, char *B, char *salt) {
char K[40], S[32], hashbuf[176];
SRPCalculateS(S, B, salt);
SRPCalculateK(K, S);
memcpy(hashbuf, I_raw, 20);
memcpy(hashbuf + 20, usernamehash, 20);
memcpy(hashbuf + 40, salt, 32);
memcpy(hashbuf + 72, A_raw, 32);
memcpy(hashbuf + 104, B, 32);
memcpy(hashbuf + 136, K, 40);
SHA1(hashbuf, 176, outbuf);
}

void SRPCalculateS(char *outbuf, const char *B, const char *salt) {
//S = ((N + B - v) % N) ^ (a + u * x) % N;
BigBuffer tmp, S_exp, S_base, x, v, u_tmp;
///////////////////////x and v calculations////////
storm.SBigNew(&x);
storm.SBigNew(&v);
SRPCalculateX(x, salt);   //x calc
storm.SBigPowMod(v, g, x, n); //v calc
///////////////////////////////////base calc //////
storm.SBigNew(&tmp);
storm.SBigFromBinary(tmp, B, 32); //b from raw
storm.SBigNew(&S_base);
storm.SBigCopy(S_base, n);   //mov eax, n
storm.SBigAdd(S_base, S_base, tmp);   //add eax, b
storm.SBigSub(S_base, S_base, v);   //sub eax, v
storm.SBigMod(S_base, S_base, n);   //mod eax, n
////////////////////////////////////////////////////
storm.SBigNew(&S_exp);
storm.SBigNew(&u_tmp);
storm.SBigCopy(S_exp, x);   //mov ebx, x
storm.SBigFromUnsigned(u_tmp, SRPCalculateU(B));  //mov ecx, u
storm.SBigMul(S_exp, S_exp, u_tmp);   //mul ebx, ecx
storm.SBigAdd(S_exp, S_exp, a);   //add ebx, a
storm.SBigDel(u_tmp);
storm.SBigDel(x);
storm.SBigDel(v);
storm.SBigDel(tmp);
storm.SBigNew(&tmp);
storm.SBigPowMod(tmp, S_base, S_exp, n);
unsigned long len = 32;
storm.SBigToBinaryBuffer(outbuf, tmp, len, &len);
storm.SBigDel(S_base);
storm.SBigDel(S_exp);
storm.SBigDel(tmp);
}

void SRPCalculateX(BigBuffer x, const char *raw_salt) {
char hash[20], temp[52];
memcpy(temp, raw_salt, 32);
memcpy(temp + 32, usernpasshash, 20);
SHA1(temp, 52, hash);
storm.SBigFromBinary(x, hash, 20);
}

void SRPCalculateK(char *outbuf, const char *S) {
char odds[16], evens[16], oddhash[20], evenhash[20];
char *saltptr = (char *)S;
char *oddptr  = odds;
char *evenptr = evens;
for (int i = 0; i != 16; i++) {
*(oddptr++) = *(saltptr++);
*(evenptr++) = *(saltptr++);
}
SHA1(odds, 16, oddhash);
SHA1(evens, 16, evenhash);
saltptr = outbuf;
oddptr  = oddhash;
evenptr = evenhash;
for (i = 0; i != 20; i++) {
*(saltptr++) = *(oddptr++);
*(saltptr++) = *(evenptr++);
}
}

unsigned int SRPCalculateU(const char *B) {
char hash[20];
SHA1((char *)B, 32, hash);
return *(unsigned int *)hash;
}

4
Introductions! / Introduction: SDFG
« on: August 19, 2008, 01:44:14 pm »
Quote
Tell us about yourself... How old are you? Where are you from? What do you do (school/work)? Where do you work, if applicable? What kind of music do you like? Do you have a girl (boy?) friend?  Are you in any other clans? What are they like (if applicable)? Any friends around here (members or otherwise)? Why do you want to join? Have you read our rules?  What's your favourite tv show? Movie? Band? Country? Continent? Season?  Type of weather? Subject in school? Chemical? Food? Drink? Book? Author? Operating system? Phone company? Computer brand? Linux distribution? Sport? Sports team? Sporting event? Game? Style of game (board, rpg, card, etc.)? Bird? Animal? Pet?

starting from the top...
Hi, I'm sdfg.
 - I'm 21 years old.
 - I live in central PA.
 - I don't do, I just am. Extremely rich!
 - I used to work at a Borders chain book store
 - I like all kinds of techno - trance, breakcore, rave, etc.
 - I don't have a girlfriend at the moment
 - I am in no clans either.
 - I have no friends on this board (but i might have a few enemies i guess)
 - Join? Whoa, no thanks, not yet, I don't think I even can, I just signed up to the forums!
 - Yes, I've read the rules.
 - Favorite TV show? Probably Seinfeld.
 - Movie? Tied between these: The Matrix, Pi, just about all James Bond movies
 - Band? Nine Inch Nails!
 - Country? Teh US of A
 - Continent? Logically, North America.
 - Season? wha? it changes you know...
 - Type of Weather? Somewhat chilly, otherwise completely normal
 - Subject in school? Math
 - Chemical? HCl - It burns so clean!
 - Food? I guess, pizza. But that's everybody's favorite.
 - Drink? Coka-cola.
 - Book? 1984
 - However, my favorite author has to be Agatha Christie. Love the suspense.
 - Operating system? fbsd on one box, Arch on my main, running Windows XP SP2 Home Edition in VMWare (I develop mainly for windows)
 - Phone company? Verizon
 - Computer brand? eMachines, I guess..
 - Linux Distro? Arch all the way!
 - Sport? None. I have never played any sports, nor been a fan of one. I'm just not a very sportsy guy, I guess.
 - Sports team? n/a
 - Sporting event? Um, superbowl?
 - Game? Occasionally StarCraft, but mostly Perfect Dark 64, Duke Nukem 64, Goldeneye 64 etc on an emulator.
 - Style of game? RTS and FPS
 - Bird? ?huh?
 - Animal? I can't stand animals,
 - Pet? ESPECIALLY having one as a pet. Way too much upkeep, and I don't really see any point to it.

So what's up, x86labs.org?

Pages: [1]