Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-11-2020, 05:41
dila dila is offline
Friend
 
Join Date: Jan 2010
Posts: 60
Rept. Given: 12
Rept. Rcvd 32 Times in 14 Posts
Thanks Given: 35
Thanks Rcvd at 74 Times in 20 Posts
dila Reputation: 32
Encryption cracking challenge

Can someone help find the key?

Code:
/*
 * poly.c crackme january 2020
 * dilabox at gmail dot com
 */

#include <stdint.h>
#include <stdio.h>

uint64_t poly(uint64_t a, uint64_t b) {
  uint64_t r = 0;
  while (b) {
    r ^= a & -(b & 1);
    uint64_t m = -((a >> 63) & 1);
    a <<= 1;
    a ^= m & 0x307fdb4d20abf247;
    b >>= 1;
  }
  return r;
}

uint64_t encrypt(uint64_t data, uint64_t key) {
  data ^= key;
  uint64_t out = 1;
  for (int i = 0; i < 64; ++i) {
    if ((0x61e261e161e261e2 >> i) & 1) {
      out = poly(out, data);
    }
    data = poly(data, data);
  }
  out ^= key;
  return out;
}

uint64_t decrypt(uint64_t data, uint64_t key) {
  return encrypt(data, key);
}

int main() {
  uint64_t key = 0;
  scanf("%lx", &key);
  if (encrypt(0xe9eec16478534a39, key) == 0xf3201dcbbeefe53a) {
    printf("GOOD\n");
  } else {
    printf("BAD\n");
  }
  return 0;
}
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cracking App come with Challenge Code new air General Discussion 2 08-19-2003 00:49


All times are GMT +8. The time now is 04:31.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )