Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda