# How are the cipher, the key and the initial message (that is not encrypted) are releted?

Suppose that $$m$$ is a message that someone player $$i$$ wants to send to a network of other players $$j\neq -i$$. The player to prevent his message from cheating by others uses an encyrpstion scheme. Say $$g:M\times Y \to X$$ denotes a cipher where $$Y$$ is the key and $$X$$ a code that makes the message to look random. The standard assumptions to be made are that $$|Y|\geq |M|$$ and $$g(\cdot,y)$$ is a bijection namely every pair of $$(m,y)$$ is associated with only one $$x$$. My question is how are the key $$y$$, the code $$x$$, and the message $$m$$ are associated? for example if we could make some operations among $$g$$, $$y$$ and $$m$$, what would that be? could we claim that $$x\oplus y \underbrace{=}_{?}m$$? or somehting like this?

• What is the origin of this Question? You did not define $g(\cdot,y)$ other than saying it is a bijection. What is the aim of this? Commented Jan 4, 2022 at 14:41
• @kelalaka what do you mean what is the aim of this? Commented Jan 4, 2022 at 15:22
• Just use RSA-KEM to encapsulate random key per user and encrypt with AES-GCM or see Libsodium... Commented Jan 4, 2022 at 15:33
• @kelalaka I have no idea what is RSA-KEM and AES-GCM... cryptography is not my field, so explain to me what are these schemes. I only know group theory that I was taught in an introductory course as undergraduate Commented Jan 4, 2022 at 16:57
• Well, domain and codomain are really dependent on the KDF: Just a Hash, HKDF, Password based... My humble advice for you reading some into dictionary books? A heavily math based An Introduction to Mathematical Cryptography and/or Introduction to Modern Cryptography: Third Edition and/or A Graduate Course in Applied Cryptography ( free book) and some free lectures? Commented Jan 4, 2022 at 17:44

Taking into account the book. I write here an example. Suppose, that we have a mechanism of communication $$\mathcal{M}=(g,h)$$ such that $$\mathcal{M}$$ is defined over $$(Y,M,X)$$, where $$Y$$ is the key, $$M$$ the message and $$X$$ the cipher spaces respectively. To simplify the problem even more I assume that $$Y=M=L=\{0,1\}^l=G$$ instead of an arbitrarily finite field $$\mathbb{F}^n$$ and write below

$$g(y,m)=x,\quad\text{is the encrypted message, which by definition equals x}$$

$$h(y,x)=m,\quad\text{is the decrypted message, which by definition equals m}$$

So, indeed $$(y,x)$$ is defined to be associated with only one $$m$$ and hence $$g(y,\cdot)$$ is bijective by definition. To anser the question how are they associated, when someone knows both $$x$$ and $$y$$, then indeed $$x\oplus_{G} y=m$$

In order to decrypt the message we have that

$$h(y,x)=h(y,g(y,m))=y\oplus_G x=m$$

where $$\oplus_{G}$$ is the operation of $$+$$ as it is defined in the finite field $$G$$. And hence we have show that the calculation that you ask for, it holds by definition.

• Anyone who has to add a comment or thinks that I am understanding something wrong you can say this to me. But I think that this is the simplest explanation under the Shannon mechanism for perfect security. Commented Jan 6, 2022 at 12:28
• Well, it seems ok to me...and after taking a look at the books mentions by @kelalaka I think that this is the case. So if the specialists here think that your answer is fine, I will accept it as the answer that solved my problem. Commented Jan 6, 2022 at 12:49
• If $g$ is just some bijection, how can you conclude that it has any connection to a field operation? The original question doesn't talk about fields at all. Commented Feb 10, 2023 at 17:59

You can't really say much beyond what is true by definition, i.e. that $$g(m, y) = x$$. The problem as stated intentionally leaves $$g$$ minimally restricted, so there are any number of concrete functions that would satisfy the statement. Further, $$M$$, $$X$$, and $$Y$$ are also minimally restricted by being defined as sets, and as such you can't assume the existence of any such function $$\oplus$$.

Remember that the purpose of using such general definitions is to prove theorems with the broadest implications. Then you know that the results apply to any particular function that satisfies the conditions.