EPiServer hash format
#11
OK, that is awesome. Thanks for information. I was able to reproduce it with Per's hash and salt. Here is some demo code:

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "openssl/sha.h"

#define SWAP(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))

int main (int argc, char **argv)
{
  // hash to find: 510827CFFBCF59AA7D51E0FC0E16B0DE1FDF8050
  // salt: 7c6276c27ff95a5cea4280de080da45c

  unsigned char salt[16] =
  {
    0x7c, 0x62, 0x76, 0xc2,
    0x7f, 0xf9, 0x5a, 0x5c,
    0xea, 0x42, 0x80, 0xde,
    0x08, 0x0d, 0xa4, 0x5c,
  };

  unsigned char pass[24] =
  {
    't', 0, 'e', 0, 's', 0, 't', 0,
    'P', 0, 'a', 0, 's', 0, 's', 0,
    'w', 0, 'o', 0, 'r', 0, 'd', 0,
  };

  unsigned int sha1hash[5];

  SHA_CTX ctx;

  SHA1_Init (&ctx);
  SHA1_Update (&ctx, salt, sizeof (salt));
  SHA1_Update (&ctx, pass, sizeof (pass));
  SHA1_Final ((unsigned char *) sha1hash, &ctx);

  sha1hash[0] = SWAP (sha1hash[0]);
  sha1hash[1] = SWAP (sha1hash[1]);
  sha1hash[2] = SWAP (sha1hash[2]);
  sha1hash[3] = SWAP (sha1hash[3]);
  sha1hash[4] = SWAP (sha1hash[4]);

  printf ("%08x%08x%08x%08x%08x\n", sha1hash[0], sha1hash[1], sha1hash[2], sha1hash[3], sha1hash[4]);

  return 0;
}

Quote:root@sf:~# gcc-4.4 -o tec tec.c -lssl
root@sf:~# ./tec
510827cffbcf59aa7d51e0fc0e16b0de1fdf8050

Hash: UQgnz/vPWap9UeD8Dhaw3h/fgFA= -> 510827cffbcf59aa7d51e0fc0e16b0de1fdf8050


Messages In This Thread
EPiServer hash format - by thorsheim - 03-16-2012, 12:12 AM
RE: EPiServer hash format - by atom - 03-16-2012, 06:15 PM
RE: EPiServer hash format - by thorsheim - 03-16-2012, 08:21 PM
RE: EPiServer hash format - by atom - 03-23-2012, 10:37 AM
RE: EPiServer hash format - by thorsheim - 03-23-2012, 11:18 AM
RE: EPiServer hash format - by atom - 03-23-2012, 05:07 PM
RE: EPiServer hash format - by thorsheim - 03-27-2012, 12:25 PM
RE: EPiServer hash format - by atom - 03-27-2012, 03:17 PM
RE: EPiServer hash format - by thorsheim - 03-27-2012, 03:27 PM
RE: EPiServer hash format - by sk5t - 03-27-2012, 05:48 PM
RE: EPiServer hash format - by atom - 03-27-2012, 06:07 PM
RE: EPiServer hash format - by thorsheim - 03-27-2012, 10:26 PM
RE: EPiServer hash format - by thorsheim - 04-04-2012, 11:25 PM
RE: EPiServer hash format - by thorsheim - 04-05-2012, 01:08 AM
RE: EPiServer hash format - by atom - 04-06-2012, 09:43 AM
RE: EPiServer hash format - by atom - 05-06-2012, 12:55 AM
RE: EPiServer hash format - by thorsheim - 05-06-2012, 01:03 AM
RE: EPiServer hash format - by atom - 05-06-2012, 03:37 PM
RE: EPiServer hash format - by troyhunt - 06-20-2012, 02:29 PM
RE: EPiServer hash format - by atom - 06-20-2012, 03:49 PM
RE: EPiServer hash format - by troyhunt - 06-21-2012, 01:12 AM
RE: EPiServer hash format - by atom - 09-07-2012, 05:12 PM