Menu

Binary put Simply

2002-12-14
2012-09-26
  • Nobody/Anonymous

    Some people have been asking about binary values and how they work.

    You have a section in memory that hold 128 bits (16 bytes) for memory.  Lets say within that 128 bits you have the letter A = 65 = 0100001  now you want to encrypt that letter A you shift it 1 bit left or right of memory (how about right).
    x = 65;
    y = 65 >> 1;
    y then equals 65/2^1 (if we pushed it right >> 2 then it would be 65/2^2)
    thus y would = (in binary) 0010000 = 32 which is a symbol that I can't remember.  If you want to push it to the left it would be y = x << 1;  y then equals 65*2^1 = 130; 1000010
    there you all go.

     
    • Anonymous

      Anonymous - 2002-12-14

      hmmmm... nice... never seen it explained that way though... might help some people figure it out...

      Zero Valintine

      PS. wouldn't make a good encryption setup though...

       
    • Nobody/Anonymous

      Depends on the byte order doesnt it?
      i think you are assuming little endian.
      if it was big endian then the left and right bit shifting will have different effects

      but all intel chipsets (and AMD) IIRC are little endian.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.