Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Reverse decryption algorithm using binary operations

I have a decryption algorithm where x is an 8 bit int:

function decrypt(x){
    return move(x, 2) ^ (move(x, 1) & move(x, 3));
}

function move(x, n) {
  return ((x >> (8 - n)) & 255) | ((x << n) & 255);
};

I would like to reverse the operation and find the encrypt function.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is not possible, because decrypt is not a bijection, i.e. it is not invertable.

Take for example these numbers:

85, 91, 107, 109, 170, 173, 181, 182, 214, 218

If you pass any of these numbers to decrypt, the returned value will be 255. So if you are given 255, what would the hypothetical encrypt have to return? The fact is, that 255 does not have enough information to tell you where it came from.

This is just one counter example. There are other groups of numbers with the same decrypt output.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!