Skip to content

Zaphrog/Encryption---Decryption-Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zaphrog Encryption Tools

Simple but powerful encryption tools for software developers.

The following package contains different encryption methods that may be used depending on the ocation:

  1. Ceaser Encryption
  2. NEZA Encryption
  3. XOR Encryption.

Caesar Encryption Python

[ ] TODO: Some very small description about Caesar

How to use it

[ ] TODO: Simple example an a link to the example.py for Caesar.

How it works

Caesar is a very simple and popular encryption method:

  • First each letter is represented by a number.
  • Then you pick a number and add it to the number equivalent of each letter.

For example: HELLO (8, 5, 12, 12, 15) encrypted with 5 would be MJQQT (13, 9, 18, 18, 20).

The global variable alphabet is a list with the most used letters in the english, spanish and german alphabets. You choose the language.

alphabet = [" ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X", "Y", "Z"]

If the number after the encryption exceeds the length of the given alphabet (26), you just do n - 26.

In the first code you can encrypt and decrypt the message, but the encryption already knows the encryption value. So i added a second code with which you can decrypt the message without knowing the encryption value.

In a longer message, it is almost 100% sure that the most used character would be ' ' (spacebar), so it will assume that the character most used in the encrypted message is spacebar and will calculate the encryption value.

There are other settings, so you can encrypt shorter messages after a few attempts. It changes settings just by pressing "ENCRYPT" again.

The caesar code also has two other functions which encrypt and decrypt messages including every ASCII character, something the previously mentioned functions cannot do.

NEZA Encription Algorithm

Neza is basically an XOR cipher with a password that changes with every block.

How to use it

[ ] TODO: Simple example an a link to the example.py for Neza.

How it works

Encryption

The first thing the program does when encrypting a message is dividing it into chunks by appending the ASCII code of each character to a list. It takes in a key from the user and then calculates the rate of change.

That is done by:

temp_key += ((256 - key) // len(message_list))

It generates an equal change for each step. At the last step it must be as close to 256 as possible.

For each letter in the list of the message it runs an XOR calculation with the modified key. At the end it reassembles a new message using the ASCII code of the new values.

Decryption

Then it just reverts the XOR for every letter and appends the correct letters to a message.

Its main weakness is that the length of the message is evident.

About

Caesar encryption and decryption with UI made with tkinter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages