dbTalk Databases Forums  

Password with special characters after conversion CP1252 to UTF-8

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Password with special characters after conversion CP1252 to UTF-8 in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gerrit Edzards
 
Posts: n/a

Default Password with special characters after conversion CP1252 to UTF-8 - 10-08-2009 , 04:22 AM






ASA 9.0.1.1899 to ASA 11.0.1.2222

ATM we are migrating customer databases from 9.0.1 to 11.0.1. As well we
are changing the collation from CP1252 to UTF-8.

The process goes like this:
* unload "old" database (ASA 9.0.1.1899; CP1252) using dbunload.exe 11.0.1
* reload structure and data using dbisqlc.exe 11.0.1
* LOAD TABLE ... ENCODING 'cp1252'

Here comes the problem:
GRANT CONNECT TO "username" IDENTIFIED BY ENCRYPTED '\x97\...x96\xc6'

Now if the user had a password with special characters like ä,ö,ü,... he
cannot log in after the migration.

What's it all about? How can the encoding specified for "GRANT CONNECT
TO"? Are we doing something totally wrong in the migration process?

TIA Gerrit Edzards

Reply With Quote
  #2  
Old   
John Smirnios [Sybase]
 
Posts: n/a

Default Re: Password with special characters after conversion CP1252 to UTF-8 - 10-08-2009 , 03:42 PM






As with pretty much any secure password system, passwords are stored as
a non-reversible hash -- that's what the encrypted password is. Old
versions of SQL Anywhere hashed the password as it existed in the
database charset encoding. When you log in to your new UTF8 database, it
gets the password in UTF8 (which is different from the 1252
representation if you use non-ASCII characters) and hashes _that_. The
hash of the password encoded in UTF8 will not match the hash of the
password encoded in cp1252 and therefore the password will not be
accepted. There's really no way around that -- you will need to reset
the password.

With new databases (I think starting at 10.0.0 but maybe it was 11.0.0),
password hashes are always based on the UTF8 encoding of the password
text regardless of the charset that is being used by the database. That
way, the password hash can be migrated to a database that uses a
different charset without encountering the problem you are having now.

-john.

--
John Smirnios
Senior Software Developer
iAnywhere Solutions Engineering

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

Gerrit Edzards wrote:
Quote:
ASA 9.0.1.1899 to ASA 11.0.1.2222

ATM we are migrating customer databases from 9.0.1 to 11.0.1. As well we
are changing the collation from CP1252 to UTF-8.

The process goes like this:
* unload "old" database (ASA 9.0.1.1899; CP1252) using dbunload.exe 11.0.1
* reload structure and data using dbisqlc.exe 11.0.1
* LOAD TABLE ... ENCODING 'cp1252'

Here comes the problem:
GRANT CONNECT TO "username" IDENTIFIED BY ENCRYPTED '\x97\...x96\xc6'

Now if the user had a password with special characters like ä,ö,ü,... he
cannot log in after the migration.

What's it all about? How can the encoding specified for "GRANT CONNECT
TO"? Are we doing something totally wrong in the migration process?

TIA Gerrit Edzards

Reply With Quote
  #3  
Old   
Gerrit Edzards
 
Posts: n/a

Default Re: Password with special characters after conversion CP1252 to UTF-8 - 10-09-2009 , 02:32 AM



Ok! We will consider the problem and give the information to our
customers. Thanks.

- Gerrit Edzards

Quote:
As with pretty much any secure password system, passwords are stored as
a non-reversible hash -- that's what the encrypted password is. Old
versions of SQL Anywhere hashed the password as it existed in the
database charset encoding. When you log in to your new UTF8 database, it
gets the password in UTF8 (which is different from the 1252
representation if you use non-ASCII characters) and hashes _that_. The
hash of the password encoded in UTF8 will not match the hash of the
password encoded in cp1252 and therefore the password will not be
accepted. There's really no way around that -- you will need to reset
the password.

With new databases (I think starting at 10.0.0 but maybe it was 11.0.0),
password hashes are always based on the UTF8 encoding of the password
text regardless of the charset that is being used by the database. That
way, the password hash can be migrated to a database that uses a
different charset without encountering the problem you are having now.

-john.

Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.