Cryptography application of Mod 7 Twisted ring counter - muneeb-mbytes/FPGABoard_edgeSpartan6 GitHub Wiki
Cryptography is the practice of protecting information by turning it into a secret code, so that it can't be read or understood by anyone who isn't authorized to do so. One of the ways to achieve this is by using a stream cipher, which is a type of encryption algorithm that uses a key to generate a stream of random bits that can be combined with the plaintext to produce ciphertext.
A mod 7 twisted ring counter is a type of circuit that generates a sequence of numbers in a loop. Each number in the sequence is represented by a binary code, which is made up of 7 bits (0s and 1s). This sequence of numbers can be used as the key for a stream cipher.
To encrypt a message using this key, we convert the message into a binary code, where each character is represented by a unique combination of 0s and 1s according to the ASCII table. Then, we combine the message with the key using a bitwise XOR operation. This means that we take each bit in the message and the key, and apply the XOR operation to produce a new bit in the ciphertext.
For example, if we want to encrypt the message "HELLO" using the key sequence "0100011", we first convert "HELLO" into its binary code "01001000 01000101 01001100 01001100 01001111". Then, we combine each character in the message with the corresponding number in the key sequence using the XOR operation. This produces the ciphertext "00001111 00000010 00000011 00000011 00001000", which is a sequence of 0s and 1s that is unreadable without knowing the key.
To make the encryption even more secure, we can replace the AND gate in the circuit with another type of logic gate, such as an XOR gate or a NAND gate. This makes it harder for an attacker to figure out the encryption key, since they would need to know the specific type of gate used in the circuit.
In summary, the mod 7 twisted ring counter can be used to generate a stream of random numbers that can be combined with a plaintext message using the XOR operation to produce ciphertext that is unreadable without the key. By replacing the AND gate with another type of gate, we can increase the security of the encryption.