[Mono-list] Mono EncryptPassword Problem

willisterman craig.willis at myknowledgemap.com
Sat Mar 28 17:07:29 EDT 2009


I've been using mono with a project for a bit, and have had no problems
authenticating using the sqlmembershipprovider.  I've now switched to using
a custom xml membership provider, and I'm having trouble with
authentication.

Using the following code:

byte[] bytes = Encoding.Unicode.GetBytes(password);
byte[] src = Convert.FromBase64String(salt);
byte[] dst = new byte[src.Length + bytes.Length];
byte[] inArray = null;
Buffer.BlockCopy(src, 0, dst, 0, src.Length);
Buffer.BlockCopy(bytes, 0, dst, src.Length, bytes.Length);
inArray = this.EncryptPassword(dst);
ret = Convert.ToBase64String(inArray);

Gives me the following results in normal ASP.NET:

(TransformPassword)Password: 12001050107011701120106011901100
(TransformPassword)Salt: 1184884153191661711661781882392521610735171
(TransformPassword)First Copy:
11848841531916617116617818823925216107351710000000000000000
(TransformPassword)Second Copy:
118488415319166171166178188239252161073517112001050107011701120106011901100
(TransformPassword)Finished Array:
15225313530214108742228777111255255134220102662012221342011997612219084011220619534135971957891087472141321191913016285135
(TransformPassword)Converted to Base64
mP2HHtZsSt5XTW//GTMi3GZCyd6GycdMer4IKHDOwyKHYcNOCWwHL9aEdxOColWH

This returns the correct password.

In Mono, I get this:

(TransformPassword)Password: 12001050107011701120106011901100
(TransformPassword)Salt: 1184884153191661711661781882392521610735171
(TransformPassword)First Copy:
11848841531916617116617818823925216107351710000000000000000
(TransformPassword)Second Copy:
118488415319166171166178188239252161073517112001050107011701120106011901100
(TransformPassword)Finished Array:
24514491551022031206418074205155410321211820814129631521861711952523298352164105242148195192791991428211725114921029197137168
74
(TransformPassword)Converted to Base64
9Q4xm2bLeEC0Ss2bBGfUdtCNHT+YuqvDGehiAzSkafKUw8BPx45SdfuV0h3FiahK

Everything is the same until "this.EncryptPassword" is called, where a
different response is returned.

This is currently breaking authentication.  Does anyone know a way to fix
this?

Any help would be great.                    
-- 
View this message in context: http://www.nabble.com/Mono-EncryptPassword-Problem-tp22761303p22761303.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list