Manipulation of Base64Strings

From: Fred Nelson (fred_at_smartybird.com)
Date: 11/30/03


Date: Sun, 30 Nov 2003 13:22:45 -0500

Hi:

I'm developing a Web App that uses a hashing algorithm to produce a string
that is returned with:

   convert.tobase64string(final hash value)

When I compare the values I use:

   hashvalue = convert.frombase64string(inpassword)

This works fine when I read and write to a textbox on the screen.

I have been advised that I should add a character at the beginning and end
of the string before writing it to a database as SQL server in some cases
will truncate leading or trailing spaces.

I have attempted: hashpass = "*" + hashvalue + "*" - then removing the first
and final values. When I do this I cause a crash as the system determines
that this is not a valid value for the convert, there must be some data type
conversion that occurs when I do this.

I have searched all through MSDN and can't find an answer to how to do
this - if anyone knows the "magic formula" I would GREATLY appreciate it.

Thanks very much!



Relevant Pages

  • Re: How do I can check a password Hash in WSE 2.0
    ... The SHA-1 hash of the password is sent in the SOAP message. ... WSE calls the AuthenticateToken method of the class deriving ... > private string HashPassword (string nnonce, DateTime nfecha, string ... and then compare your computed hash against the supplied one. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Is String Hashing Effective in String comparisons
    ... string class more efficient. ... overhead of continuing to compare if a character is different. ... in the hash functions i have encountered we loop through all the ... computing the hash for a string of length L takes Htime units. ...
    (comp.programming)
  • Re: String Identity Test
    ... Well, it's not about curiosity, it's more about performance. ... Python uses some tricks to speed up string comparison. ... # compare the size ... # compare the hash ...
    (comp.lang.python)
  • Re: How do I can check a password Hash in WSE 2.0
    ... private string HashPassword (string nnonce, DateTime nfecha, string ... > hash, and then compare your computed hash against the supplied one. ... > password or original data. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: md5 encryption
    ... > simon wrote: ... >> compare the hash as they cannot compare the string. ... >> So, technically, given a hash key you can get a string. ...
    (alt.php)