It seems less common with newer websites, but many websites I need an account on (like for paying bills, etc.) prevent me from creating a password with spaces in it.  This only makes things more difficult to remember, and I am aware of no database or programming restrictions on spaces in passwords, encrypted or (heaven forbid) otherwise.  Why, then, is the spacebar so commonly discriminated against when it comes to signing up for a site?
Why do certain sites prevent spaces in passwords?
security;login;privacy
There are a huge amount of stupidities when it comes to passwords in websites.Some have purely technical reasons (valid or not, that's another question, but nearly all of them are not):Your password must be four characters length and have only digits.(By limiting a password to 0001 .. 9999 range, you can simply store them as a number, plaintext, in the database)Other are explained by some erroneous thoughts that they will make passwords more secure:Your password must start with a capital letter and end with a digit.(By doing this the developer, or the manager, assumed that this will actually force the users to choose a safe password, while the rule as Your password must contain min. 6 characters and contain at least one capital letter, lowercase letter and a digit will magically fail to do it)Other, finally, are explained by the fact that passwords are stored plaintext, and there are some ambiguities about how they are stored, processed or retrieved, and there are no time to unit test them.Your password contains an invalid character .or,Your password y$46*A'xD<7&=cN&sF5_!d contains some invalid characters. Use characters from Latin alphabet and digits only.or,Your password cannot contain whitespace characters.In all three cases, the developer was just insure that passwords like this will be stored correctly.In the first case, what if  will be transformed into %C3%A9 when sent? Or what if the database will store  incorrectly?In the second case, what if PHP (why PHP?) cannot deal with unicode, and does something terrible when receiving a password like this? What if < character causes trouble? What if & character is interpreted as a separator in an URL (assuming that for some reason, the password is being sent through GET instead of POST)? What if ' is interpreted by the database, because, guess what, we have no idea what SQL Injection is and how to avoid it? Or what if ' is transformed into \'?In the third case, what if PHP (again?) trims whitespace in some cases and not in others? What if the administrators (who have surprisingly the access to users passwords in plaintext) are lost because they see only one whitespace, while the user have set three consecutive whitespaces?In all three cases, those ambiguities are easily solved through testing, especially unit testing. But in a huge amount of projects, there is no testing at all, and no time to test (but still plenty of time to debug later).This means that whether the developer tries to think about the possible consequences of allowing spaces, or unicode characters, or just any character outside ASCII 48..57  65..90  97..122 (digits, lowercase letters, uppercase letters), the easiest way, when testing is not possible, is to just forbid them.In my opinion, this is the sole reason to forbid spaces. Yannis Rizos gave another reason related to UX. While being a plausible reason in theory, it doesn't work at all in practice: websites made by people who actually care about UX don't fix stupid password rules. Instead, websites where whitespace is actually forbidden are in most part done by people who never heard about UX. This is especially true since forbidding any character is really annoying from UX point of view, as any password-related restriction, including the useful ones, as the minimum number of characters.