Skip to content

Fallen-Eleonor/Part-of-the-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Our joint project with dljubyvyj for ukode: Race01.

The essence of this project is to develop an algorithm for decryption. The program accepts a corket value, which is encrypted with the special character ? and depending on this, the necessary parameter does not go, selecting them from among the possible ones. The algorithm reminds you all of the familiar brute force, but for good purposes - encryption and data protection.

Encryption-vs-Decryption

Encryption is the process of converting plain text into cipher text, i.e. converting the text from readable format to nonreadable format to secure the conversation between two parties or from the unauthorized person; on the other hand, Decryption is the process of converting ciphertext into plain text, i.e. converting the non-readable text into readable text which anyone can understand. Both methods use secret keys to perform desired operations.

decryption

The implementation of the decryption algorithm is not an easy task, as it seemed to us at first, but if you delve into the very essence, then everything becomes clear.

First, we have an inference rule, which we will write as a simple spelling of a write error.

Снимок экрана от 2022-09-21 13-50-45

Let's display its output in the terminal:

.Снимок экрана от 2022-09-21 13-45-17

We need the program to output an error of the value (operand, operation, result) that we pass. The program accepts the specific character "?".

Снимок экрана от 2022-09-21 13-55-42

The current values of the command line go through a cycle during which the type of error is determined and, in fact, the presence of a non-contradiction of logic - the length of the string should not be less than 0.

Снимок экрана от 2022-09-21 13-58-52

The macros display further output of the cause of the error.

Let's display its output in the terminal:

Снимок экрана от 2022-09-21 13-54-52

We need to diversify the record type, ignoring spaces, as an example, thanks to a special function - mx_strtrim.

Снимок экрана от 2022-09-21 14-04-10

We can write the values however we like without violating the framework of the input rule.

Consider the conclusions for both acts. According to the conditions of basic and creative.

Basic output:

Снимок экрана от 2022-09-21 14-13-17

Creative output:

Снимок экрана от 2022-09-21 14-18-46

Consider the structure of the program in the area of conditions and output.

Снимок экрана от 2022-09-21 14-20-54

4 elements are passed to the main computational function: command line values, which in massive equivalent will mean argv[1], argv[3], argv[2], argv[4]. Where argv[2] is the operation whose value is checked in the same function.

Next, we implement the mathematical functions that are provided for by the task, and their output, respectively.

Снимок экрана от 2022-09-21 14-21-08 Снимок экрана от 2022-09-21 14-21-11 Снимок экрана от 2022-09-21 14-21-13 Снимок экрана от 2022-09-21 14-21-17

The algorithm for deriving these values was made in a way that I did not really like, because I think that it could still be made shorter.

Снимок экрана от 2022-09-21 14-21-35

Comparing boundaries and calculating the maximum and minimum values is an important step for the implementation of mathematical functions.

Снимок экрана от 2022-09-21 14-22-15

As a result: the program was brought to the level of its full performance. The team understood the basic principle of data decryption using this example. No memory leaks have been reported.

About

Decryption algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published