Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Congratulations on a brilliant idea and a great site..."

Geography

Where in the world do Tek-Tips members come from?

MD5 encryption returns different value on compact framework

jcaulder (Programmer)
11 Nov 11 12:54
I have code that encrypts a user password and stores in a database.  The initial insertion occurs using a desktop application running full 2.0 .Net framework.  When the user attempts to log in on a handheld device running the compact framework, I use the same code to take the supplied user password and encrypt it.  I then compare that value to the database stored value and they don't match.  Can anyone assist in telling me what to change to resolve this?  I thought it was the encoding but no combination works to fix this.  It is and always has been using ASCII encoding.  The code is below:


    Function EncryptToMD5String(ByVal SourceText As String) As String

        'Create an encoding object to ensure the encoding standard for the source text
        Dim Ue As New System.Text.ASCIIEncoding
        'Retrieve a byte array based on the source text
        Dim ByteSourceText() As Byte = Ue.GetBytes(SourceText)
        'Instantiate an MD5 Provider object
        Dim Md5 As New MD5CryptoServiceProvider
        'Compute the hash value from the source
        Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
        'And convert it to String format for return
        Return Convert.ToBase64String(ByteHash)

    End Function

Thanks!
jcaulder (Programmer)
11 Nov 11 13:07
Just for clarification, the desktop application generates the following value:

IctSnx399ivl5GGB1Sub9g==

The compact framework generates this:

/CrhsbWmX7UNQCDpGpdcug==

The text being encrypted is:  cjones7308

TIA!
jcaulder (Programmer)
14 Nov 11 13:30
Disregard the post.  The information provided to me and posted was inaccurate.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close