It’s pretty hard to argue with the idea of managing your bookmarks on a webpage. It avoids the hassle of unsynchronized local bookmarks scattered across different systems and browsers. Just remember ONE webpage, and you can get to all the rest!

A few years ago I went looking for code to let me do this from my server, giving me ultimate control. bookmark4u scratched my itch. I got on board with it when it still supported frames, which was exactly what I wanted. YES I LOVE FRAMES! Bugger off! 😛 The author didn’t agree, and dropped support a long time ago, so I cling to my older version. Even so, over the years, it has been ROCK SOLID and done everything I wanted (this may be the only software I have ever used for which this is true!).

A more recent update to Mysql (4.1 I believed) changed the internals of a common way of encrypting passwords, the PASSWORD(‘plaintext’) function. Example SQL:

insert into MY_PASSWORDS (‘webuser’, PASSWORD(‘webuserpswd’) );

select user from MY_PASSWORDS where password=PASSWORD(‘webuserpswd’);

More precisely, after some reading, I found that the PASSWORD() function is really intended for internal use by Mysql, and external use is not recommended. In version 4.1.1, the output from PASSWORD() was extended from 16 bytes to 41 bytes. Any apps that expect the older size no longer work. Cest la vie.

Of course, the problem is that bookmark4u uses it. What to do? The Mysql encryption docs give details on all the available encryption functions. SHA1() is recommended – it is cryptographically strong, and should be widely available. And perhaps most importantly, it is not likely to change out from under us. I replaced all calls to PASSWORD(‘blah’) with SHA1(‘blah’), which generates a long hash string for the password. Worked like a charm. The only thing I had to do besides search/replace PASSWORD( with SHA1( was to alter the password column to make it wider – 60 characters was recommended somewhere, and it did the job for me. Of course, we could have just extended the column in the first place, but why go halfway? That’s no fun! 😛

Leave a Reply