Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

slooksterPSV

macrumors 68040
Original poster
Apr 17, 2004
3,544
306
Nowheresville
Ok I'm not sure I understand this, though it makes sense in my mind and I don't want to get this wrong.

If I have a key that is hexadecimal its a 16-bit's right? 0-F right?
If I have a key that takes 5 pairs of hexadecimal bits its 10-bits right? AB CD EF GH IJ
Now if I have a 64-bit encryption it takes the 5 pairs of hexadecimal bits right? so 2^5 = 32 bytes, so its a 32 byte word or character string is what I'm meaning. Now when it encrypts that word to a 64-bit encryption it does (in programming terms) this, it bit shifts the 32 byte word 63 places right. e.g.

wordtwo = word << 63

That's what makes the 64-bit encryption, correct? But it does it to each individual character, correct? But it may be in an algorithm to mix up the letters and to add a key value and mix in the key value correct?

I need to make sure I have this down, cause it makes sense to me, but I'm not sure if its right or wrong.
 

plinden

macrumors 601
Apr 8, 2004
4,029
142
I'm not quite sure what you're asking, but a hexadecimal number (can't say "digit") is 4 bits, e.g. F = 1111.

A byte is represented by two hex numbers, e.g. A9 = 1010 1001.

So five pairs of hexes is 5 bytes or 40 bits.

On the other hand, if you're talking about characters rather than the actual hex representation of the value, each ASCII character is 8 bits, so five pairs of characters is 10 bytes or 80 bits. UTF-8 characters can be between 1 and 4 bytes, or 8-32 bits.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
A single hexidecimal value is 4-bits (which is 0.5 bytes). This can be represented as a single character [0-9,A-F], but one should not confuse the display of the character with the value (as an ASCII character is 8 bits)

A pair of hexidecimal values can represent 256 (0-255) values, which is a single byte (or 8 bits). So 5 pairs of hex digits = 5 bytes = 40 bits.

A 64 bit value would require 8 bytes or 16 hex values.
 

GeeYouEye

macrumors 68000
Dec 9, 2001
1,669
10
State of Denial
Bit-shifting a 32 bit number 63 places in either direction will result in a totally zeroed number, ie

t = 123456;
t = t << 63;
printf(t);

would print "0".
 

slooksterPSV

macrumors 68040
Original poster
Apr 17, 2004
3,544
306
Nowheresville
GeeYouEye said:
Bit-shifting a 32 bit number 63 places in either direction will result in a totally zeroed number, ie

t = 123456;
t = t << 63;
printf(t);

would print "0".
Oh duh, that's right, how they explained it was perfect so yeah.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.