fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4. #include <time.h>
  5.  
  6. typedef uint8_t u8;
  7. typedef uint32_t u32;
  8.  
  9. u8 scr_tbl[64] = {
  10. 0x3d, 0xd6, 0xf4, 6, 0xa3, 0xc9, 0x8d, 0xcd, 0x3a, 0xe6, 0x4e, 0x52,
  11. 0xd9, 0xff, 2, 0x61, 0xb9, 0x42, 0x7a, 0x20, 0x37, 0xc8, 0xb4, 0x1e, 0xe,
  12. 0x8f, 3, 0xc, 0xba, 0x67, 0x62, 0x40, 0x45, 0x38, 0xfc, 0x4c, 0x1a, 0xbc,
  13. 0x6d, 0xc7, 0xdb, 0x12, 0x87, 0xdb, 0x21, 0x90, 0xf6, 0x97, 0xdf, 0x90,
  14. 0xd2, 0x4f, 0xf5, 0x9f, 0xfd, 1, 0xd0, 0x54, 0x13, 0x13, 0xe2, 0xc7,
  15. 0xc5, 0x28
  16. };
  17.  
  18. u32
  19. auth_code( u32 a1 )
  20. {
  21. u32 v2, v4;
  22. u8 *v3;
  23.  
  24. v2 = a1;
  25. v3 = scr_tbl;
  26. do
  27. {
  28. v2 ^= *( u32 * ) &scr_tbl[4 * ( ( a1 >> ( ( u8 ) v3 - ( u32 ) scr_tbl ) ) & 0xf )];
  29. v4 = *( u32 * ) v3;
  30. v3 += 4;
  31. a1 ^= v4;
  32. }
  33. while( v3 != &scr_tbl[32] );
  34. return v2;
  35. }
  36.  
  37. int
  38. main( int argc, char *argv[] )
  39. {
  40. u32 challenge;
  41.  
  42. printf( "Zaquencer V1.5 Authorization Generator\n" );
  43. printf( "Usage: %s [challenge]\n\n", argv[0] );
  44. if( argc > 1 )
  45. challenge = strtoul( argv[1], NULL, 16 );
  46. else
  47. {
  48. srand( time( NULL ) );
  49. challenge = rand( );
  50. }
  51. printf( "%s %08lX -> %s %08lX\n",
  52. (argc > 1) ? "Challenge" : "DemoChal", challenge,
  53. (argc > 1) ? "Authorization" : "DemoAuth", auth_code( challenge ) );
  54. return 0;
  55. }
Success #stdin #stdout 0.01s 5292KB
stdin
12345678
stdout
Zaquencer V1.5 Authorization Generator
Usage: ./prog [challenge]

DemoChal 03DECA1F -> DemoAuth 071EA8FA