LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2011, 04:35 AM   #1
topheraholic
Member
 
Registered: Aug 2008
Location: shanghai
Distribution: ubuntu
Posts: 128

Rep: Reputation: 15
Question little question about assembly language !thanks


i am reading a book and here is an example of string encryption on it ,but i do not understand why?
it says"
a plain text message is transformed into an encrypted string called cipher text by XORing each of its character with a character from a third string call key.

Code:
KEY = 239        ;any value between 1-255
why it should be 1-255?

thanks
 
Old 05-28-2011, 05:09 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,388
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
The code works by using the xor a byte at a time (which is more like obfuscation than encryption, but I digress). A byte is 8 bits, meaning it can hold values from 0 to 255, so any number in this range can be used to xor all 8 bits at a time. However, the value 0 would not change the text at all (since doing an xor with 0 is an identity operation), so the code suggests any value from 1 to 255 (ie, binary 00000001 to 11111111).
 
1 members found this post helpful.
Old 05-28-2011, 05:50 AM   #3
topheraholic
Member
 
Registered: Aug 2008
Location: shanghai
Distribution: ubuntu
Posts: 128

Original Poster
Rep: Reputation: 15
oh,thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
assembly language! please help me! thanks in advance! topheraholic Programming 3 04-16-2011 10:31 AM
Is Assembly Language considered a Structured Language? theKbStockpiler Programming 4 01-30-2011 10:09 AM
How to learn assembly language? darkangel29 Programming 8 01-12-2009 01:30 PM
Assembly Language Books JMJ_coder Programming 3 05-06-2008 05:04 PM
SPARC assembly language jclark00001 Programming 3 02-26-2003 09:52 PM


All times are GMT -5. The time now is 08:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration