How encryption code works

Text being encrypted

Encryption:

Encryption takes a character, and puts it through a set of if-then statements. If it recognizes the character, it will encrypt and replace it, otherwise it will leave it as is. It repeats this process until it has reached the end of the text. Encryption code detects the length of the text by adding an ∞ at the end of the text, and then counting character by character until it reaches the ∞.

Text being decrypted

Decryption:

Decryption essentially does the opposite of encryption. It takes a character, and puts it through a set of if-then statements which are opposite from encryption. For example, if encryption converted an 'a' to a '#', decryption would convert the '#' back to an 'a'. If it did not recognise the character, it will leave it as it is, because if the character was not recognised by decryption, then encryption didn't recognise it either, so the character wasn't encrypted. It repeats this process until it has reached the end of the text. It will detect the length of the word using the function described in encryption.

Beginning animation

Animation:

Animation is executed by the following algorithm: Print, wait, erase. An object is printed, erased, and then printed in a slightly different spot. Repeating this algorithm again and again very quickly results in a smooth animation. Animations can be used to entertain users, such as the fun beginning animation, or for demonstration, such as the encryption and decryption animations which encrypt or decrypt text in front of you.

Virtual Assistant:

Virtual assistant needs to be smart- knowing how to respond to any kind of input it gets. Encryption code's virtual assistant uses a series of if-then statements to determine what exactly the user is typing. For example, if it finds encryption in the phrase that the user has typed, it will ask the user more about encryption. Although encryption code has been tested well and the Encryption code software team does not expect any problems, if any arise, the virtual assistant will suggest ways such as running diagnostics or rebooting system to try to fix the problem. It also can redirect the user to reboot system or run diagnostics. The virtual assistant will make every effort to understand what the user wants to convey, but if it does not, it will suggest contacting the Encryption code Customer Service team via email or google form.

Settings:

Settings are just a bunch of variables. Whether it be encryption animation, animation speed, or encryption type, all settings are stored in variables. When. the program starts, all variables are initialized to defaults. When the user enters settings, all the current variable values are displayed. If the user chooses to change them, then the variable is changed. For example, if a user went to settings and turned off encryption animation, the encryption animation variable would change. Then, when the user went to encrypt something, then Encryption code would see that the encryption animation was disabled, and not display the animation. Coming soon in Encryption code 1.2.0, Are going to be text file operated settings, which can be customized and saved even when the user reruns the code.

Memory:

Memory is basically a string variable. It stores a string of what the user has encrypted. When the user encrypts a new message, the message is appended through concatenation of strings. The string can be redefined as an empty string if the user chooses to erase memory. In Encryption code 1.1.9 is long-term memory, which is operated by a shelved text file. it stores the memory to the text file and the variable.

Running Diagnostics

Running diagnostics is a text of whether the code's vital features: Encryption, Decryption, and presentation are working correctly. It generates a random message, which it encrypts and decrypts. If the encrypted and decrypted message is identical to the original one, then it will display encryption and decryption as working.

Reboot system

Reboot system does essentially what you would get by rerunning the program. All data is erased, all variables are initialized, and the program is restarted.

Main menu

Main menu is the home base: The program returns there after performing any procedure. After the program starts and displays the beginning animation, it goes to the main menu. At the main menu, you can type the letter corresponding to the action you want to perform. The main menu will then redirect you to whatever action you choose to do.

Command line interface (for version beta only)

Encryption code beta's Command line interface works with a split input software. In its in input, it expects two things: a command and an argument. The command tells it what to do such as encrypt or decrypt, and the argument tells it what to use. Using string slicing, it separates the command from the argument. It determines what to do using the command, and it does it with the argument. for example, if you typed in '-enc hello world', Encryption code beta would know to encrypt with the -enc command, and know to encrypt 'hello world' because it is the argument.

Automatic copy and pasting

Automatic copy pasting works by using the subprocess module to access you computer's clipboard. It can copy your encrypted message to the clipboard, so that you can paste it when you want to send it to someone.

Putting it all together

Encryption code is a Python script that produces and interactive user experience along with carrying out its intended purpose: encrypting and decrypting. It runs on one main algorithm with many sub algorithms. The main algorithm does the following: Beginning animation, initialize variables, and then main menu. After that, the program keeps looping in the main menu until the user chooses to quit the program. From the main menu, the user can choose multiple options, which are the sub algorithms. When the user chooses an option, the code will perform the sub algorithm assigned to that action. How each of the sub algorithms work are explained in the above dropdowns. Encryption code is a great and fun way to keep you text secure and safe. Keep looking out for new versions of Encryption code!

Stats for nerds

Encryption code:

  • Modules import required:

    1. Time: for wait time

    2. Socket: for keyboardinterrupt

    3. Shelve: to create, open and store in text file

    4. Subprocess: to copy to and paste from clipboard

    5. Randint from Random: to generate random wait times and phrases

  • Encryption if-then statements

    1. using one-line syntax sugars: encrypted_letter = ('#' if letter == 'a' else ('?' if letter == 'b' else ('a' if letter == 'c' else ('&' if letter == 'd' else encrypted_letter))))

  • Virtual assistant server:

    1. 0.05 second text string processing

    2. uses if in then statements (to detect a specific phrase in the response of the user)

This page was created by the Encryption code Software team. ©2020, Encryption code