Jump to content

Encryption – The Basics

- - - - -

  • Please log in to reply
20 replies to this topic

#1
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts

Encryption – The Basics


What is encryption?
Short answer – Making something unreadable without first decrypting it.
Long answer – Let’s take an example string, ‘Text’ now as it is it is perfectly readable by any program, even your naked eye, now with encrypting it I could apply an algorithm to that string and transform it to virtually anything, for example, ’1548795200 7’ yeah, of course this was just a random number, but with some algorithm you could transform that string to anything. All you need is an algorithm. Might sound simple, yeah let’s just invent a formula, well fellas, when highly sensitive data is in place, and maximal security is needed then it is not so simple. We can virtually encrypt anything, a string, a file, a telephone line, sound, movies, text, internet connection and whatever we need to secure virtually.

When is this used?
This is used when we need security, we need to secure our sensitive documents, our financial information etc. We don’t need to encrypt our mp3 files, I bet you would not want to encrypt and decrypt an mp3 every time you want to listen to some music on your computer.

Why do we use it?
Well, nowadays privacy is a very important thing that every human needs, and we all want to feel safe about our data. We all know about crackers (usually mistaken as hackers) and we don’t want our document to be spread online freely for everyone to see. So that is one of the many reasons, another one would be to secure a software, even a shareware program, so as not to crack it simply by modifying some addresses in the program, if everything is encrypted it will be harder, as before we need to decrypt that, or find a security hole in the algorithm and exploit it, but still that is harder.

How can we do it?
We can achieve this by applying an algorithm to the file/string, in this manner we are actually destroying the original data and storing it as encrypted and the only way to retrieve the data back is not by going into the recycle bin and restoring it lol, but generally by applying the reversal of the encryption algorithm and get our data.

Now what’s next?
Now I made a software, which you can download at the end of this article, which you can experiment with. It contains 3 samples of the simplest string encryption algorithms I could find. These are called:
  • Flipper
  • Shifter
  • Reverser

Now let’s start with the Flipper:
This one is very, very, very, simple. This divides the string into pairs, for example takes this string, ‘Text Here’ and it divides it into pairs of two like this ‘Te’, ‘xt’, ‘ H’, ‘er’, ‘e’ (note that near the H there is a space, that is counted as a character. And it flips each character with the other, it takes the first character and replaces it with the second and replaces the second with the first, so it is something like that ‘eT’, ‘tx’, ‘H ‘, ‘re’, ’e’ so the result will be like this:
‘eTtxH ree’

Now let’s continue with the Shifter:
This one perhaps is not so easily detected, but still is not secure enough, this takes a string, again let’s take ‘Text Here’ and it takes the ASCII of each and every character and it makes the ASCII plus one, for example if the ASCII is 60 this one will return it as 61. Basically the next letter in the alphabet (at least in the English alphabet, but let’s not forget of characters like space and such) so that string would be something like ‘Ufyu!Ifsf’

And last one the Reverser:
This one is basically very simple, it just reverses the string for example ‘Text Here’ would become ‘ereH txeT’

What’s the fun?
You can experiment with that software I made you can even apply more than one encryption on the same string. For example you can use the Reverse, the Shifter and then Flipper, and Shifter again and Reverser and so one. In that way the only method to get your original string back would be to click the buttons again in the reverse order! Or you will never get your original string back! Yeah that’s right, so those algorithms applied several times on the same string would make it a pretty secure encryption.

Attached Files



#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
  • Location:New York, NY
Whats the difference between encoding and encrypting?

#3
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well I am not 100% sure on this one but with 'encode' you can encode a video with a specific codec (like DivX) or transform analog signal into digital form encding can even be used in compression etc... while encrypting is more related to encrypting data.
I think....

#4
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
Encoding is the process of transforming information from one format into another

Encryption is the conversion of data into a form, called a ciphertext, that cannot be easily understood by unauthorized people

#5
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I think that I was close :)

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
One thing to be aware of is that all three methods described, while valid examples of encryption, are almost completely useless for protecting data by today's standards. Most of the strong versions of encryption employ algorithms developed by mathematicians to make uncovering the original message extremely difficult.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Yeah - As I think that I said in the article its self, these are not recommended for use where sensitive data needs to be secured. There are only the very basics!

#8
Chinmoy

Chinmoy

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 392 posts
thats good enough for starting.you can move on to higher ones like rc-64 maybe...but thats where you start.definitely.

#9
Guest_Kaabi_*

Guest_Kaabi_*
  • Guests
I like learning about encryption, it is pretty interesting. Use an algorithm to encrypt strings and then use a special key to decrypt it. As you said, starts off simple and gets extremely complicated as you increase security.

#10
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I totally agree. Besides that it's a very interesting subject, and has an important role in the IT sector.

#11
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Maybe you could do a tutorial to try and decrypt the text - without knowing the algorithm! You could run a test which does all the common algorithms, in search of the original text. :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#12
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I don't think so. Thats quite hard to do and explain.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users