'inverse of symbol in cryptographic operation

The * represents a cryptographic operation where a symbol can be mapped to a different symbol. The following table represents the operation where the symbol set S is {A, B, C, D, E, F}.

enter image description here

I want to find the inverse of E according to the above table. How can I find it?



Solution 1:[1]

It seems that A is the identity element since it doesn't affect the operations and the operation is not commutative!

We can see this from this; C*B = F != E = B*C

Once we know the identity element then the inverse of an element X, if exists, is an element Y such that X * Y = A This is the right inverse ( since the operation is not commutative the left and the right inverses can be different). It turns out the left and the right inverses are the same with little investigation.

So the inverses are

  • Inverse of A = A
  • Inverse of B = B
  • Inverse of C = C
  • Inverse of D = D
  • Inverse of E = F
  • Inverse of F = E

Just write a Java array

int[] inverse = {0, 1, 2, 3, 5, 4};

To store the inverse, instead of recalculation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1