Editing 2700: Account Problems

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 15: Line 15:
 
In computer systems, every {{w|Character (computing)|"character"}} (letter, digit, punctuation, etc.) is represented as an integer. For example the lowercase letter 'a' is represented as the number 97, and the digit '1' is represented as the number 49 (when using the {{w|ASCII}} character encoding or {{w|Unicode}} character encoding). A {{w|String (computer science)|"string"}} refers to a sequence of characters, and can be used to store arbitrary text (for example names, messages, passwords). Strings can be arbitrarily long, so some mechanism must be used to record their length. One approach is to store the length explicitly ({{w|String_(computer_science)#Length-prefixed|Pascal string}}). Another approach is to mark the end of the string using a specific character, usually the {{w|null character}} (which is represented as the number 0); such strings are called {{w|null-terminated string}}s, and are used by the {{w|C (programming language)|C programming language}}. Both approaches have advantages and disadvantages. A limitation of null-terminated strings is that they cannot be used to represent text containing embedded null characters. This is usually not a problem, because normal text never contains null characters. However, if somehow a null character were to end up in the string, it would cause problems: any code that uses that string would assume this null character marks the end of the string, so the string would effectively be cut off.
 
In computer systems, every {{w|Character (computing)|"character"}} (letter, digit, punctuation, etc.) is represented as an integer. For example the lowercase letter 'a' is represented as the number 97, and the digit '1' is represented as the number 49 (when using the {{w|ASCII}} character encoding or {{w|Unicode}} character encoding). A {{w|String (computer science)|"string"}} refers to a sequence of characters, and can be used to store arbitrary text (for example names, messages, passwords). Strings can be arbitrarily long, so some mechanism must be used to record their length. One approach is to store the length explicitly ({{w|String_(computer_science)#Length-prefixed|Pascal string}}). Another approach is to mark the end of the string using a specific character, usually the {{w|null character}} (which is represented as the number 0); such strings are called {{w|null-terminated string}}s, and are used by the {{w|C (programming language)|C programming language}}. Both approaches have advantages and disadvantages. A limitation of null-terminated strings is that they cannot be used to represent text containing embedded null characters. This is usually not a problem, because normal text never contains null characters. However, if somehow a null character were to end up in the string, it would cause problems: any code that uses that string would assume this null character marks the end of the string, so the string would effectively be cut off.
  
βˆ’
Account registration systems often place requirements on passwords in an attempt to encourage users to pick stronger passwords. For example, they might ask that the password include at least one "special character" (such as <code>!@#$%^&*</code>). Cueball misunderstood this requirement as referring to characters such as the null character (which is more accurately referred to as a {{w|ASCII#Control_characters|control character}}). Cueball managed to type the null character as part of his password somehow (on some systems it is possible to type the null character using {{w|Null_character#Representation|certain keyboard shortcuts}} such as <code>Ctrl</code>+<code>Space</code>, <code>Ctrl</code>+<code>@</code>, <code>Ctrl</code>+<code>2</code>, or <code>Alt+0</code> {{w|Alt_code|using the number pad}}), but the software running the registration system was poorly written and could not cope with this &ndash; it allowed him to create an account with that password, but then when he tried to log in with the same password the system didn't accept it.  
+
Account registration systems often place requirements on passwords in an attempt to encourage users to pick stronger passwords. For example, they might ask that the password include at least one "special character" (such as <code>!@#$%^&*</code>). Cueball misunderstood this requirement as referring to characters such as the null character (which is more accurately referred to as a {{w|ASCII#Control_characters|control character}}). Cueball managed to type the null character as part of his password somehow (on some systems it is possible to type the null character using {{w|Null_character#Representation|certain keyboard shortcuts}} such as <code>Ctrl</code>+<code>Space</code>, <code>Ctrl</code>+<code>@</code>, <code>Ctrl</code>+<code>2</code>, or <code>Alt+0</code> {{w|Alt_code|using the number pad}}), but the software running the registration system was poorly written and could not cope with this &ndash; it allowed him to create an account with that password, but then when he tried to log in with the same password the system didn't accept it. This in an unwanted circumstance {{{citation needed}}}.
  
 
It's unclear how that particular situation might arise in real software, but here is a similar situation that can easily happen in practice: Suppose a website's registration form allows the user's new password to have up to 20 characters, but due to a programmer error the login page only accepts passwords with up to 18 characters. If the user picks a medium-length password (say with 12 characters), all is well. But if the user picks a password with 20 characters, they will find themselves in the same position as Cueball, being able to register but not able to log in. Some additional situations are described [[#Trivia|below]].
 
It's unclear how that particular situation might arise in real software, but here is a similar situation that can easily happen in practice: Suppose a website's registration form allows the user's new password to have up to 20 characters, but due to a programmer error the login page only accepts passwords with up to 18 characters. If the user picks a medium-length password (say with 12 characters), all is well. But if the user picks a password with 20 characters, they will find themselves in the same position as Cueball, being able to register but not able to log in. Some additional situations are described [[#Trivia|below]].

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)