Consider a very simple symmetric block encryption algorithm, in which 32-bits blocks of plaintext are encrypted using a 64-bit key.

Encryption is defined as $C = (P\oplus K_L) \boxplus K_R$

where $C$ = ciphertext; $K$ = secret key;

$K_L$ = leftmost 32 bits of K;

$K_R$ = rightmost 32 bits of K;

$\oplus$ = bitwise exclusive or;

$\boxplus$ is addition mod $2^{32}$enter image description here

Show the decryption equation. That is, show the equation for P as a function of $C$, $K_L$ and $K_R$

below is my attempt, I am kinda lost.

  • $\begingroup$ What are you confused about? You show an equation at the bottom; are you dissatisfied by it? The only thing "wrong" I can immediately see is notational: using $\otimes$ for modular addition and $\ominus$ for modular subtraction, which would appear a tad inconsistent. $\endgroup$
    – poncho
    Feb 10, 2015 at 11:36
  • $\begingroup$ Looks good to me. $\endgroup$
    – Ken
    Feb 19, 2015 at 23:24

1 Answer 1


The ciphertext is $C=((p \oplus K_0) + K_1) \bmod 2^K)$, so whatever the result of the Xor's operations, the ciphertext will also be 32 bits.

Since the size of plaintext is 32 bits which is similar to the size of $K_0,K_1$. So, the module operation is just an extra operation because $X \bmod 2^K$ is always $X$ for $X < 2^K$.

So, $C=(p \oplus K_0) \oplus K_1$.

To get the plaintext, perform the XOR operations in reverse order to the Ciphertext. Plaintext, $P=(C - R_1) \oplus R_0$.

  • $\begingroup$ Welcome to Cryptography.SE. FYI, we have $\LaTeX$/MathJax is installed on our site. Check the edits. $\endgroup$
    – kelalaka
    Mar 27, 2022 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.