Hi Ihr

Ich wollte soeben den erw�hnten Artikel umsetzen - habe aber allerdings ein
Problem.

Ich erhalte immer den Fehler "Die arithmetische Operation hat einen �berlauf
verursacht." und zwar in folgender Funktion:

public string ComputeSaltedHash()
{
        // Create Byte array of password string
        ASCIIEncoding encoder = new ASCIIEncoding();
        Byte[] _secretBytes = encoder.GetBytes(_password);
                
        // Create a new salt
        Byte[] _saltBytes = new Byte[4];
        _saltBytes[0] = (byte)(_salt >> 24); // HIER WIRD DIE EXCEPTION
GEWORFEN!!
        _saltBytes[1] = (byte)(_salt >> 16);
        _saltBytes[2] = (byte)(_salt >> 8);
        _saltBytes[3] = (byte)(_salt);

        // append the two arrays
        Byte[] toHash = new Byte[_secretBytes.Length + _saltBytes.Length];
        Array.Copy(_secretBytes, 0, toHash, 0, _secretBytes.Length);
        Array.Copy(_saltBytes, 0, toHash, _secretBytes.Length,
_saltBytes.Length);

        SHA1 sha1 = SHA1.Create();
        Byte[] computedHash = sha1.ComputeHash(toHash);

        return encoder.GetString(computedHash);
}

Ich benutze 1:1 den Code von Chris...

Dani


_______________________________________________
CSharp.net mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/csharp.net

Antwort per Email an