View Single Post
  #1  
Old 01-13-2018, 23:56
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
Lightbulb Can you solve this keygen problem?

Code:
bool check_key(uint64_t x) {
  uint64_t r = x;
  for (size_t i = 0; i < 64; ++i) {
    for (size_t j = 0; j < 6; ++j) {
      r ^= (((x >> (1 << j)) & (i >> j) & 1) << i);
    }
  }
  return (x && r == 0);
}
The objective is to find valid 64-bit input keys that make the function return 'true'.

1. How many valid input keys are there?
2. Can you make a generator to enumerate all valid keys?

Z3 (or other SMT/SAT) tools are not allowed as solutions!
Reply With Quote