Public Group

Encryption Question

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

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 on other sites
No 128 bit encryption generally means that the key used to encrypt the data is 128 bits long.

Share on other sites
Then whats a bit?

Share on other sites
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 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 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,

I'm confused >.>

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 on other sites
are you sure your up to writing a simple encryption program if you dont understand bits, bytes and keys?

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.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 13
• 9
• 9
• 15
• Forum Statistics

• Total Topics
634076
• Total Posts
3015351
×