# Two-Layer Security Algorithms to Prevent Attacks on Data in Cyberspace
## 4 Experiment
### Kasiski Test Cryptanalysis Algorithm  
The ciphertext cryptanalysis algorithm was implemented on the ciphertext obtained from the proposed algorithm to identify whether the Vigenere key obtained from the proposed algorithm can be obtained from the ciphertext. As shown in Algorithm (3), first, a ciphertext was taken, repeated values in that ciphertext were found, and index identification of these repeatable values was made. After index identification, the key length algorithm was implemented in which the distance of index-1 to index-n was determined, and the greatest common division (GCD) was implemented on the obtained values. After that, the values obtained from GCD were considered as key length, the index of coincidence algorithm was implemented, and key identifications were made.  
Figure 19: Decryption Result.  
If the ciphertext obtained by the proposed algorithm is paired so, 95% of the values in the ciphertext are not repeatable. In very few cases, it may be possible that some values become repeatable, but in most cases, the value is not repeatable shown in Table 5. The implication is that the proposed algorithm is used for cloud transmission or that the security analysis of the algorithm is done. The security of the Vigenere key cannot be broken by using the Kasiski test, and the security of the data cannot be decrypted. If an attacker applies techniques such as data decryption mechanisms or the Kasiski test, the attacker cannot decrypt the ciphertext obtained by this algorithm nor can they obtain the Vigenere key by the proposed algorithm, which is the novelty of this paper. When a user decrypts data, the Vigenere key must first be applied to the data, after which the static key can be used. If an attacker uses a wrong key instead of a valid one, the attacker obtains irrelevant data instead of the original ones. To access the original data, the same Vigenere key that is obtained from the plaintext must be applied. Data decryption may be impossible if an authentic user forgets the Vigenere key or static key. Data decryption can be possible only when these keys are stored in the database, and if the user forgets the key, the user can retrieve the key from the database and use it. If the key decryption mechanism is developed, then the attacker can also develop an algorithm to decrypt the data, from which the data decryption can be possible. Whenever data need to be encrypted, a Vigenere key should be generated from each plaintext. During data decryption, the Vigenere key should be applied first, and then the static key should be used to increase the efficiency of the data so that the attacker cannot access data.  
In Table 6, the researchers used different static keys to encrypt and decrypt the data. No matter how effective an algorithm is that is designed to encrypt data, the data cannot be secured unless the key used in that algorithm is effective. Data security depends on the algorithm as well as the key. When data are encrypted with one key and decrypted with two keys, it is difficult for an attacker to find two different keys of two different sizes.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{2}{c}{**Proposed Algorithm**} & & & & **Kasiski Test** & \\ \multirow{2}{*}{**Testing**} & \multirow{2}{*}{**Ciphertext Length**} & \multirow{2}{*}{\begin{tabular}{c} **Vigenère Key** \\ **Length (V)** \\ \end{tabular} } & \multicolumn{2}{c}{\begin{tabular}{c} **Kasiski Key** \\ **Length** \\ **Algorithm** \\ **Results (K)** \\ \end{tabular} } & \multicolumn{2}{c}{\
\begin{tabular}{c} **Length** \\ **Equalization** \\ **(V, K)** \\ \end{tabular} } & \multicolumn{2}{c}{
\begin{tabular}{c} **Index of** \\ **Coincidence** \\ **Algorithm** \\ \end{tabular} } & \multirow{2}{*}{**Key Identify**} \\ \hline
1 & 17 & 17 & 4 & V \(\
eq\) K & No & No \\
2 & 6 & 6 & 1 & V \(\
eq\) K & No & No \\
3 & 6 & 6 & 1 & V \(\
eq\) K & No & No \\
4 & 6 & 6 & 3 & V \(\
eq\) K & No & No \\ \hline \hline \end{tabular}
\end{table}
Table 5: Ciphertext Cryptanalysis.