Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binary Conversion Not Matching Up

Status
Not open for further replies.

tickko

Programmer
Dec 12, 2002
25
0
0
US
hello, i'm hoping that someone can help with this little problem. i have an third party app with a gui interface and sql back end. the app has the capablities of entering in users through the front end but i have created a sql script that reads an alternative table of users and inserts them into the user table of the third party app (for batch entry and profile creation).

my problem lies in the password column, its a binary data type. but when i convert my text password to binary text it does not match up.

results for password (1234567)
3rd party app (password is verified and works)
0x9F9E9992949D959E129491A9A9A3A9E6E90FE9C2

sql conversion
0x3132333435363720202020202020202020202020

--sql script to convert text to binary
declare @uPassword char(20), @binPassword as binary(20)
set @uPassword = '1234567'
set @binPassword = cast(@uPassword as binary(20))
print @binPassword

heres the script that i am using to convert the text to binary...am i doing something wrong here? i put 20 because thats the length of the column in the 3rd party db.

any help would be greatly appreciated...i have little exprience in binary data.

thanks,
t
 
SQL binary conversion does simple hex/ascii encoding:

31hex = 49dec = ASCII 1
32hex = 50dec = ASCII 2
...
20hex = 32dec = ASCII space

... while 3rd party app probably encrypts password. Sorta like comparing apples and oranges :x
 
with that being said...i have no way of importing the password unless i can get the encryption string?
 
Very likely - unless you know exact coding/encryption method used by 3rd party app.
 
If you contact the thriord party, they probably won't give you the code to encrpyt but perhaps they can give you a compiled utility to do so for bulk inports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top