Vigenere ciphers : Need help for math analysis I've been learning about Vigenere ciphers and then thought of another method to Encrypt and decrypt that.

This's my method to encrypt :

I have a msg : "messages from father to his son"
I have a key : "home"
And the cipher text : "tsewmkwk fxse krhtjr mv lzl gvv"


I've created the Mathematics algorithm for the encryption, but get stuck for the decription.
This's what I've made fro encryption :

msg : "messages from father to his son"
key : "homemess ages fromfa th ert ohi"


So, I include the msg as part as the encryption method.
And,

my problem is :

How is mathematical/cryptanalysis method for implement this procedure below ?

msg : "tsewmkwk fxse krhtjr mv lzl gvv"
key : "homemess ages fromfa th ert ohi"
to get it back to "messages from father to his son" ?


May be somebody can help me, I'm not clever enough to make an equation.

EDIT :

As I know, the vigenere equation basically like this :

Ci = Ek(Mi) = (Mi + Ki) mod 26


with E is the encryption and K is the key for the Encryption. And you know that the decryption from that encryption is like this :

Mi = Dk(Ci) = (Ci - Ki) mod 26


right ?

Now, I recreate the encryption using this formula :

C_i=E_k (M_i )=(∑_(i=0)^k▒(M_i+K_i ) + ∑_(i=k+1)^m▒〖(M_i+K_i))〗 mod 26


But, that's my problem is you can see my stupidity to create the equation. But I can convert the equation to the programming but not the opposite. I want to make the equation for analysis report. May be this add the unclear problem, and please don't tell me how to encrypt or decrypt that. May be a point to the basic math can enlighten me a little.

Thanks...
First, you decrypt the first four characters. The plaintext you find is the key for the next block of four characters, so after this you can decrypt the next block, finding the key for the block after that, and so on.

This means you will need a case distinction: one case for the first $|K|$  characters (where $|\dots| \stackrel{\text{def}}{=} \text{the length of $\cdots$}$), and one case for the rest of the text. Mathematically, you could write this down as follows:

$$C_i = \begin{cases}i &lt; |K| &amp; M_i + K_i \pmod{26}\\
i \geq |K| &amp; M_i + M_{i - |K|} \pmod{26}\end{cases}$$

For $i&lt;|K|$ we take the standard Vigenère formula. For the rest, you take the ciphertext one keylength back as key. Note that my formula assumes you start with $i=0$; if you start with $i=1$ you'll need $\le$ and $&gt;$ instead.

Then, decryption is done similarly:

$$M_i = \begin{cases}i &lt; |K| &amp; C_i - K_i \pmod{26}\\
i \geq |K| &amp; C_i - M_{i - |K|} \pmod{26}\end{cases}$$