Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda