asp.net - C# Winform Application: Decoding 64bit Web Tokens On 32bit Client Machines -
asp.net - C# Winform Application: Decoding 64bit Web Tokens On 32bit Client Machines -
my company has eternal pointing web server allows our clients finish questionnaires , submit results internal database.
each external user's form gets unique guid. illustration [9c43207a-fd84-499a-82c3-247e7337335f]. security purposes token generated c# code using form guid, on 64 bit web-server.
in order internal user see form, in our winforms application, web browser has been embedded , next url entered web browser address bar... [https://company_domain_name.com/formonline.aspx?token=token_generated_by_64_bit_webserver].
the code below generates token...
//************************************************************** // illustration code //************************************************************** system.guid my_guid = new system.guid("9c43207a-fd84-499a-82c3-247e7337335f"); string txtid = my_guid.tostring(); system.text.stringbuilder str = new system.text.stringbuilder(); str.append(txtid); //************************************************************** // other string values appended stringbuilder // security reasons //************************************************************** string hashresult = txtid.gethashcode().tostring(); str.append(hashresult); string finalresult = encodeto64(str.tostring()); //************************************************************** // method //************************************************************** private string encodeto64(string toencode) { byte[] toencodeasbytes = system.text.asciiencoding.ascii.getbytes(toencode); string returnvalue = system.convert.tobase64string(toencodeasbytes); homecoming returnvalue; }
unfortunately web token generated on internal users 32bit client machine different web server version , web page fails open.
actual examples below.
[guid] [9c43207a-fd84-499a-82c3-247e7337335f]
[64bit token] [qgt7fcakb4etzmq4nc00otlhltgyyzmtmjq3ztczmzczmzvmi1rydwujltmymdyzmzu4mq==]
[32bit token] [qgt7fcakb4etzmq4nc00otlhltgyyzmtmjq3ztczmzczmzvmi0zhbhnlizeynjcynjm0nti=]
downgrading web server 64bit 32bit not option.
altering code on web server not option, proprietary software scheme , lucky developers gave me code utilize create token.
is possible utilize calculation same 64bit result on 32bit client?
c# asp.net .net winforms 32bit-64bit
Comments
Post a Comment