Three Parts:Creating the Encryption MethodCreating the Decryption MethodPolish and Use
Whatever your reason is for wanting to create an encryption program, creating one can be fun and very challenging. However, it might be tough to figure out how you do it if it is your first time. This article covers the general idea and the basic steps you'll need to take in order to create a functional and realistic encryption program.
EditSteps
EditPart One of Three:
Creating the Encryption Method
-
1Choose the program's language. This should be the first step you take, just so you know exactly what you can and can't do. Some languages are easier to create an encryption in than others. JavaScript and Python are easy to learn and are better at creating customized encryption methods than other programs. These two also have free software available online to edit and execute code with. While the example for this article will be written in Python as a demonstration, you can use any language you want.
-
2Draft up the encryption method. Depending on the language you are coding in, you might have limitations to what you can and can't do relating to encryption designing. It is best to know these and make a mental note of any limitations that exist. Once you understand them, decide what the final encryption of a simple word will look like. In this article, we're going to encrypt every character into a number format that is four numbers long. You can make the program encrypt it into any characters and any way you want, but for simplicity, consider using numbers first.
Here is the method that the example will be using:- Four digit encryption
- First number is a random number
- Second and third numbers represent the numeric position of a letter in the alphabet. Numbers will start with a '3', and are followed by the number itself
- The last number is also a random number.
- Four digit encryption
-
3Create the conversion program. This is going to be the most complex and difficult part of the encryption program. If you aren't good at solving puzzles, this may take some time. Above is a picture of a finished encryption method with comments.
-
4Test it. It is recommended you use a software built for the specific programming language you wrote the code in to execute it. Be sure you test all of the following:
- That the encryption method correctly returns only the characters you want it to return;
- That the program can handle all the characters it is intended to handle; and
- That it has correctly encrypted complex words such as "HOLA" and "WHATS UP?".
EditPart Two of Three:
Creating the Decryption Method
-
1Use one-way encryption if needed. Sometimes you may just need to encrypt data one-way, without wanting to have a method of decryption. One-way encryption is a good way of storing the following types of data:
- Passwords. Many online websites that include a user system only encrypt passwords one-way before storing them in a database. An example is hashing, which is used to safely compare passwords without leaving them exposed as the client and server compare them.
- Software. Almost every software program is encrypted in a way that only the computer can decode. This prevents malicious attackers from duplicating the software and selling it for a profit.
-
2Study the encryption method. Understanding exactly how you encrypted a word or phrase helps you determine what information you need to look at, and how that encrypted information can be decoded.
-
3Write the decryption method. It is a lot like solving the puzzle you created yourself. It will be much easier than the way you encrypted it. The image above shows the decryption method that goes with the previous example.
EditPart Three of Three:
Polish and Use
-
1Make a simple menu system. Most likely you don't want to have to open the program's code, scroll to the bottom, and type in the functions to encrypt and decrypt the data. This makes it really easy and quick to encrypt or decrypt data on the minute. The image above shows the menu system for the example.
EditTips
- Be sure your final system can handle any errors that may arise, such as unsupported characters.
- Consider revising the encryption method occasionally, just to make sure anyone who is trying to crack your code will have a harder time.
- If you plan on using the encryption program to communicate with a friend, send him/ her the final program as an executable. There are plenty of online services to export a program as an executable software.
- If you don't plan on using it to communicate, keep it on a USB for easy encryption whenever you need it.
EditWarnings
Article Info
Did this article help you?
Yes
No