Re: how these 2 functions may differ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



James wrote:
yes, I'm pretty sure they are. I am sure that the text representation
of them on screen (displayed in text box control) is identical.

I see the vbscript code formatting was lost in my post... I'll try to
attach in a .txt file (windows notepad.exe)

I'm reading through msdn docs now and I'm thinking this has something
to do with the fact that the rc4 cipher is using ascii characters
0-255 and the .net asciiEncoding class only uses 0-127.... maybe I
need to add a step where I change the encrypted text to unicode, then
base64 it?

Encrypted text is not text. It is binary data. I suggest you stop using a
string to hold it. Doesn't the encryption routine give you a byte[] out?
And the Base-64 encoding functions take a byte[] as input. No Unicode
needed, no encoding needed, just pass the byte[].




"Family Tree Mike" <FamilyTreeMike@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:474F2B84-167E-4113-B368-89AD0C327D1A@xxxxxxxxxxxxxxxx


"James" wrote:

Hello,

I'm having an issue that a previously posted on but after
re-reading that post I realize its a mess and it would be a real
pain for someone to lend a
hand based on that.. so here is a much more direct question:

could anyone tell just how these .net base64 functions differ from
the vbscript base64 functions? When using them if I encode the text
'test' I get
the same result from them all, however, if I first RC4 encrypt the
text 'test' and then encode that, the results differ between the
vbscript and ..net functions?


Are the encrypted strings in both cases identical?

Mike


.



Relevant Pages

  • Re: how these 2 functions may differ?
    ... I see the vbscript code formatting was lost in my post... ... Doesn't the encryption routine give you a byteout? ... could anyone tell just how these .net base64 functions differ from ... When using them if I encode the text ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how these 2 functions may differ?
    ... The original encryption and base64 encoding is ... I attached vbscript code that does the encryption/encoding if you ... int intLength = strPwd.Length; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how these 2 functions may differ?
    ... I assume the vbscript chr and asc functions use the default codepage just like they do in the microsoft.visualbasic .net namespace. ... I was using the ASCIIEncoding.ASCII class to go from string to bytes and vice versa. ... So I changed my base64 functions to the following and all is well. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Store passwords in scripts ("Best practice"?)
    ... It is said that given the expertise at NSA and enough ... Use Encryption. ... Each user has a loginscript in VBscript. ... The loginscript must access data in a MSSQL-database on each logon... ...
    (microsoft.public.scripting.vbscript)
  • Re: base64 encode/decode issue
    ... I assume the vbscript chr and asc functions use the default codepage just like they do in the microsoft.visualbasic .net namespace. ... So I changed my base64 functions to the following and all is well (as long as the encryption and decryption is taking place on systems using the same code page, which in my case it is). ... Secondly check that RC4 encryption is working correctly at both ends. ...
    (microsoft.public.dotnet.languages.csharp)