# Two-Layer Security Algorithms to Prevent Attacks on Data in Cyberspace
### Contribution  
Some researchers have used the double Vigenere cipher encryption algorithm in which the data are encrypted repeatedly using the same key. Some researchers have developed hybrid algorithms, and data were encrypted with the help of these algorithms. There are so many efficient symmetric encryption algorithms available, such as AES and DES, which can be used to protect data, but with the help of these algorithms, data are encrypted and decrypted using a single key. If an attacker gains access to the key, the attacker can decrypt all encrypted text with the same key, which is a problem. If an efficient symmetric algorithm is developed in which a unique key is obtained from each plaintext, and the key can be used only for that text from which it is derived, the data can be secured in a better way. The advantage of deriving a unique key from each plaintext is that each plaintext key works only for that plaintext. After obtaining the unique key of the plaintext, the cipher data depend on this key, and the data cannot be decrypted without this key. If the user has access to the static key, the attacker can steal all the data, but when the length of the plaintext key depends on the size of the plaintext and the key is random, a user cannot guess the key nor can it be taken away. In this paper, an efficient algorithm was developed in which data encryption is done with one key while decryption is done with two keys. The first key is user-defined, while the second key is a plaintext-derived key. The user-defined key is called a static key, while the one derived from plaintext is called the Vigenere key. The length of the static key is dependent on the user, which can be snatched from any mechanism, but the length of the Vigenere key is equal to the length of the plaintext, which cannot be broken, and such a Vigenere key cannot be obtained with the help of the Kasiski test. Two layers of security are provided to protect data from attackers. A \"CipherText Algorithm\" is developed in the first layer to derive a cipher value and unique key from the plaintext. After obtaining the cipher value and the Vigenere key from the proposed algorithm in layer-1, these cipher values and the Vigenere key are combined to obtain a ciphertext on which no cracking mechanism can be implemented nor the proposed algorithm's security breached and for which the Vigenere cipher algorithm is used in layer-2. The Vigenere key and cipher value are intersected with the help of the Vigenere cipher algorithm, and a secure value is obtained, which is called ciphertext. Therefore, to decrypt this ciphertext, it is necessary to apply the ciphertext and \"Vigenere key\" to the Vigenere cipher algorithm, after which the data can be decrypted. The biggest advantage of using the proposed algorithm is obtaining a unique key from each plaintext, the length of which equals the length of the plaintext. The data are encrypted using a static key, while at decryption time, the \"Vigenere Key\" derived from the plaintext is used first before the static key can be used. If an attacker devises a mechanism or exploits the Kasiski test algorithm, the attacker cannot obtain the Vigenere key in any way because the ciphertext depends on the Vigenere key. Unless the ciphertext and Vigenere key are combined, the data cannot be accessed, which is the novelty of this paper.  
The remaining part of the proposed paper is organized somewhat like this. In Section 2, previous work is reviewed. In Section 3, the proposed methodology is discussed. In Section 4, implementations of the proposed methodology are presented. In Section 5, a comparison of the proposed algorithm with the previous algorithms is made, and the performance of the better algorithm is discussed. In Section 6, the conclusion is made based on different results.