Header Banner
Null Byte Logo
Null Byte
wonderhowto.mark.png
Cyber Weapons Lab Forum Metasploit Basics Facebook Hacks Password Cracking Top Wi-Fi Adapters Wi-Fi Hacking Linux Basics Mr. Robot Hacks Hack Like a Pro Forensics Recon Social Engineering Networking Basics Antivirus Evasion Spy Tactics MitM Advice from a Hacker

How to Make a Secret Language with Python

Jun 22, 2015 01:52 PM
Jun 22, 2015 07:06 PM
Women operating an early computer.

Sometimes our information important. So important that we have to encode it to keep it away from criminals. What better way to encode information than to make our own encoder with Python?

In this tutorial, we will cover the basics of cryptography in hopes to make a "gibberish" language.

635705506379220448.jpg

Introduce Your Script

At the beginning of every Python script, we have to initialize the modules we must use, and also tell the user what to do.

635705510972481948.jpg
  • The first line is mandatory for any Python script. It tells our terminal that we are using Python.
  • The second line of this script imports the time module. This will allow us to delay our script for a desired amount of seconds with time.sleep(seconds).
  • The third and fourth line are just a header for our script, so the user knows what this is.
  • The fifth line uses the time.sleep() function we talked about earlier.
  • The sixth line asks our user for the message to encode. We use "raw_input()" to capture what the user types.
  • The seventh line creates an empty string where our final encoded message will be stored.

Change Characters of Message

In the next portion of this script, we will use a for loop, and an if else statement. The for loop will say, for every character (char) in this message (message), check to see which character is being used, and convert it to a different character of my choice. Finally, we will add each character to the empty string.

635705516906782057.jpg
  • First of all, we say for every character in this message, do the following. We can say that by using the for loop. "For char in message:"
  • Then we go through the alphabet, lowercase and uppercase, and say, "if this character is an a, change it to a #, if this character is a b change it to a *" and so on. Also, when we change these characters, we add them to the final message, called "encoded" by using +=. At the end of the for loop, we use an else command for special characters that we don't need to encode.

Print Message

Finally, we will print our message. I also wanted a nice little box around our message, so I used:

print ("+")+"-"*len(message)+("+")*

To make a box around the message, size depending on the length of the message.

635705522135281885.jpg

Make a Decoder

To make a message decoder, just repeat the process of making the encoder, except swap each character in the for loop. For example, if we changed an "A" to a "#" in our encoder, than simply make it so that if the message contains a "#" it will change to an "A".

Conclusion

Wow! We made a new language in little to no time!

The script used in this tutorial can be found here:

And as always, )4 aqm j#x@ #pa $m@uv)qpu qt 3qp3@tpu, n@#x@ vj@0 )p vj@ 3q00@pv u@3v)qp.

Thanks for reading!

The next big software update for iPhone is coming sometime in April and will include a Food section in Apple News+, an easy-to-miss new Ambient Music app, Priority Notifications thanks to Apple Intelligence, and updates to apps like Mail, Photos, Podcasts, and Safari. See what else is coming to your iPhone with the iOS 18.4 update.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!