501 - not implemented
501 - not implemented

Reputation: 2688

how to calculate bitwise operation back

i want to crypt some informations with bitwise operations.

For example two numbers with bitwise or: 8 and 1 to 9.

But how can i encrypt it it to get my root nombers?

greetz

Upvotes: 1

Views: 1660

Answers (3)

Alexander Galkin
Alexander Galkin

Reputation: 12524

From all bitwise operations only XOR is reversible. Look for XOR-cipher, the easiest way to encrypt your data. In your case you still have to know at least one number from both to restore the second one! There is no way that you can restore both.

Upvotes: 2

Rich O'Kelly
Rich O'Kelly

Reputation: 41757

You can use a bitwise xor to achieve this, it's known as a xor cipher.

Upvotes: 2

ninjalj
ninjalj

Reputation: 43688

OR is not reversible. XOR is reversible.

Upvotes: 3

Related Questions