Jump to content
  • Advertisement
Sign in to follow this  
orcfan32

Encryption Question

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am going to write a simple encryption program in C++, but before I start off, I have a simple question: Does 128 bit encryption mean that one character is converted to 128 different characters?

Share this post


Link to post
Share on other sites
Advertisement
A bit is a binary value that is used to make up computer storage. Multiple bits are combined to form bytes which are then combined to form larger data. A byte is typically 8 bits in size: so it has 8 pieces that can be either one or zero for a total of 2 ^ 8 different values in combination.

Share this post


Link to post
Share on other sites
So if 8 bits is a byte then 128 / 8 = 18, which 2 to the eigth power = 18. So that means that since a byte is 1 character, then it's 18 characters long for each character?

Share this post


Link to post
Share on other sites
Your math is off. 128 / 8 is 16. 128 bits is 16 bytes. But the number of bits in the encryption is not per character in the input. It is simply the length of the key used in the encryption. What the key does is dependent on the encryption algorithm,

Share this post


Link to post
Share on other sites
Just saying you are confused doesn't help us help you. What are you confused about? What a bit is? What a 128 bit key is? How to do encryption?

Share this post


Link to post
Share on other sites
are you sure your up to writing a simple encryption program if you dont understand bits, bytes and keys?

Share this post


Link to post
Share on other sites
Encryption works like this:
message -> | Encryption Algorthm(Cipher) | -> encrypted message.

The Encryption Algorthm uses a math transformation of some sort based on a 'key'.

Let's take Caesar cipher, since it's the easiest. Basically, we take each character and replace it with a letter a fix number of letters down the alphabet.

So a + 1 = b.

a is our message, 1 is our key and b is our enrypted message.

Since our key can only go from 1 ~ 25, our key is maximum of 5 bits.(it offers 5 bit ecryption).

Key length is important, the larger the key, the more 'guesses' it takes to figure out the code. With our Caesar cipher, a person would only have to guess a maximum of 25 times before s/he can read our encrypted message without knowing the key.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!