# Security of a custom non linear hill cipher

Initially let me state that this is an atypical type of cryptographic encoding. First I break up my key into three parts $k = {W,\overrightarrow{b},\alpha}$. the $W$ is simply a $n \times n$ matrix, $\overrightarrow{b}$ is a vector of size $n$ and $\alpha$ is a scalar. My message is also a matrix with dimensions $k \times n$ I define my encoding as

$E_{W,\overrightarrow{b},\alpha}(M) = [\sigma^{\alpha}(W \cdot M^T + \overrightarrow{b})]^T$

$\sigma = \frac{1}{1 + e^{-x}}$

The addition of the vector occurs element by element per column and this is mapped to every column (essentially a linear transformation occurs per element in the message matrix). After that a sigmoid function to the power of $\alpha$ is applied to every element. Does this encoding still suffer from the known-plaintext attack or does the non-linear function deal with that? And is their any other known weakness to this encoding? Thank you in advance.

• In $\frac{1}{1 + e^{-x}}$, what is $x$? Also, what ring are these matrices computed over? The Reals? – poncho May 12 '15 at 13:12
• @poncho $W,M,b$ all consist of real values. $\sigma$ is applied to every element in the new matrix created by matrix operations between $W,M,b$. x represents the value of the element (belongs to the real set). – Armen Aghajanyan May 12 '15 at 15:19
• Well, typically we don't use real operations to do crypto (for one, it's hard to transmit a single value from a set of size $\aleph_1$ in a bounded number of bits, hence we have problems sending the ciphertext). And, if you try to use floating point to simulate the reals, well, you aren't using the reals anymore; instead you're using a hard-to-analyze-cryptographically set of operations (and you have to worry about things such as numeric stability); it'd be easier just to AES-encrypt the bitwise representations of the floats. – poncho May 12 '15 at 17:00
• @poncho I need to use this type of cipher because it contains some relative homeomorphic properties. Numeric stability is not the issue since I do not care for lossless encryption. Some amount of error is actually good in my application. I'm just wondering what weaknesses this encoding can possibly have e.g known plain text attack, since this is a variant of hills cipher. I really appreciate your feedback btw. – Armen Aghajanyan May 12 '15 at 17:09
• As with the regular Hill cipher, this is easy if $n$ is not too large and given enough known plaintexts. – Aleph May 13 '15 at 21:53