allanrodigo / Graph-based-Cryptography

This repository contains a Python implementation of a graph-based message encryption system. The system uses a graph to represent the characters of the ASCII table, and then encrypts a message by traversing the graph in a random order. The decryption process is the reverse of the encryption process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction: Cryptography plays a key role in information security, being responsible for transforming readable data into an unreadable form, known as ciphertext. To ensure data confidentiality and integrity, various encryption techniques are employed. This report discusses a graph-based cryptography technique, which uses the structure of a scrambled graph to encode and decode messages.

Graph Based Encryption Technique: The graph-based cryptography technique combines elements of substitution and transposition ciphers to perform encryption and decryption of messages. This approach uses a graph, composed of nodes (vertices) and connections between these nodes (edges), as the basis for the cryptographic process. In this context, the nodes represent the characters present in the message to be encrypted.

Process Steps:

Generation of the Original Graph: The first step is to generate an original graph, in which each node represents a character. Connections between nodes are established sequentially, following a predefined order. For example, if we are working with ASCII characters, each node will represent an ASCII character, and connections between nodes will be defined based on the order of the characters in the ASCII table.

Graph scrambling: Next, the original graph is shuffled to increase the complexity of the cryptographic process. This is done by randomizing the order of the nodes in the graph. The scrambled graph connections are updated using the scrambled keys. In this context, the braces correspond to the edges that represent the possible transformations between the characters. Each node in the scrambled graph is connected to another node, forming a new random order.

Message Encoding: During the encoding process, each character in the original message is checked to determine if it is present in the scrambled graph. If so, one of the connections (keys) available for that character is randomly selected. The encoded character is added to the result along with the next character in the encoding path. The encoding path represents the sequence of characters traversed during the encoding process. This randomized replacement approach makes the coding process non-deterministic.

Message Decoding: During the decoding process, the encoding path is used to reverse the encoding process. Each encoded character is checked against the reverse graph, which maps the encoded character back to the original character. The decoded character is added to the result, following the decoding path. Decoding is possible due to the reversibility of the connections in the scrambled graph.

Cipher Classification and Key Space: This graph-based cryptography technique can be classified as a combination of substitution cipher and transposition cipher. Substitution occurs when characters are encoded by randomly selecting one of the available connections for each character in the scrambled graph. Transposition occurs when the encoding path is followed to get the next character to be added to the result. This combination of substitution and transposition increases the complexity of the algorithm and makes cryptographic analysis more difficult. The key space of this encryption technique is determined by the number of possible permutations of the connections in the scrambled graph. The size of the keyspace is equal to the factorial of the number of nodes in the graph. In the case of this code, the keyspace size equals 256! (factorial of 256), which results in an extremely large number of key possibilities.

Security Analysis: The graph-based cryptography technique offers an interesting approach to encode and decode messages. Using the structure of a scrambled graph and the keys that represent the connections between the characters, this technique combines elements of substitution and transposition to guarantee the confidentiality of the data. Graph randomization and random key selection make cryptography more resistant to frequency analysis attacks. Furthermore, the complexity introduced by the encoding path makes cryptographic analysis and algorithm cracking difficult.

However, it is important to point out that a complete analysis of the security of this algorithm requires further studies and cryptographic analysis. As with any encryption technique, there may be specific vulnerabilities or methods of attack that have yet to be discovered. Therefore, the security of this technique must be evaluated against best practices and guidelines established by the cryptographic community.

Comparison with Other Ciphers: When compared to other encryption algorithms such as symmetric key ciphers (eg AES) or public key ciphers (eg RSA), the graph-based cryptography technique has some distinct advantages. The size of the keyspace, determined by the number of possible permutations of connections, contributes to the robustness of this technique in terms of security. Furthermore, the randomness introduced into the encoding process and the use of transposition make this technique less susceptible to cryptanalytic attacks.

Real World Applications: The graph-based cryptography technique can find applications in scenarios where randomness and complexity provide an additional layer of security. This can include secure messaging, encrypted storage of sensitive data, and secure network communications. The combination of substitution and transposition, together with the size of the keyspace, makes this technique an interesting option in situations where data confidentiality is crucial.

About

This repository contains a Python implementation of a graph-based message encryption system. The system uses a graph to represent the characters of the ASCII table, and then encrypts a message by traversing the graph in a random order. The decryption process is the reverse of the encryption process.


Languages

Language:Python 100.0%