Click here to Skip to main content
15,895,256 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: SSCLI now compiles on MacOS X Pin
Ray Cassick13-Nov-02 7:23
Ray Cassick13-Nov-02 7:23 
GeneralRe: SSCLI now compiles on MacOS X Pin
James T. Johnson13-Nov-02 7:37
James T. Johnson13-Nov-02 7:37 
General.NET redistributable related Pin
Shamoon11-Nov-02 16:56
Shamoon11-Nov-02 16:56 
GeneralRe: .NET redistributable related Pin
David Stone11-Nov-02 18:43
sitebuilderDavid Stone11-Nov-02 18:43 
GeneralRe: .NET redistributable related Pin
RichardEastes13-Nov-02 15:55
RichardEastes13-Nov-02 15:55 
GeneralActiveDirectory ldap Pin
Anonymous11-Nov-02 10:01
Anonymous11-Nov-02 10:01 
GeneralSoap serialization Pin
Gerosa11-Nov-02 6:00
Gerosa11-Nov-02 6:00 
GeneralPassword Encryption Pin
Derek Lakin11-Nov-02 3:41
Derek Lakin11-Nov-02 3:41 
I use the code described below to one-way hash a supplied user's password to verify it against the one-way hashed password stored in a database.
While the code works and provides the functionality I am looking for I am not convinced that it does it in the quickest/most elegant/most sensible/safest way.
Any ideas for improvement?

// Convert the supplied password into a char array
char[] password = new char[50];
System.IO.StringReader reader = new System.IO.StringReader(this.textBoxPassword);
reader.Read(password, 0, 50);

// Copy the char array into a byte array for encryption
byte[] bPassword = new byte[50];
for(int i = 0; i < 50; i++)
{
	bPassword[i] = (byte)password[i]);
}

// Hash the password
System.Security.Cryptography.SHA1 shaM = new System.Security.Cryptography.SHA1Managed();
byte[] hash = shaM.ComputeHash(bPassword);

// Convert the hash into a char array
char[] cHash = new char[hash.Length];
for(int i = 0; i < hash.Length; i++)
{
	cHash[i] = (char)hash[i];
}

// Create a string from the hash for db verification
string hashword = new string(cHash);

// ... Perform db verification

GeneralRe: Password Encryption Pin
Daniel Turini11-Nov-02 3:47
Daniel Turini11-Nov-02 3:47 
GeneralRe: Password Encryption Pin
Furty13-Nov-02 16:07
Furty13-Nov-02 16:07 
QuestionSubclassing? Pin
Stan Shannon11-Nov-02 2:19
Stan Shannon11-Nov-02 2:19 
AnswerRe: Subclassing? Pin
James T. Johnson11-Nov-02 3:11
James T. Johnson11-Nov-02 3:11 
GeneralRe: Subclassing? Pin
Stan Shannon11-Nov-02 3:45
Stan Shannon11-Nov-02 3:45 
GeneralRe: Subclassing? Pin
Paul Watson11-Nov-02 4:00
sitebuilderPaul Watson11-Nov-02 4:00 
GeneralRe: Subclassing? Pin
Stan Shannon12-Nov-02 0:48
Stan Shannon12-Nov-02 0:48 
GeneralRe: Subclassing? Pin
Martin Haesemeyer13-Nov-02 6:49
Martin Haesemeyer13-Nov-02 6:49 
GeneralRe: Subclassing? Pin
Stan Shannon13-Nov-02 7:08
Stan Shannon13-Nov-02 7:08 
QuestionHow do I catch ListView's scrolling? Pin
8-Nov-02 2:01
suss8-Nov-02 2:01 
AnswerRe: How do I catch ListView's scrolling? Pin
Stan Shannon11-Nov-02 2:24
Stan Shannon11-Nov-02 2:24 
GeneralRe: How do I catch ListView's scrolling Pin
ikinari11-Nov-02 13:46
ikinari11-Nov-02 13:46 
GeneralWeb Service Session State Pin
Code for Food7-Nov-02 12:15
Code for Food7-Nov-02 12:15 
QuestionHow to set form to maximum form... Pin
Munti7-Nov-02 11:43
Munti7-Nov-02 11:43 
AnswerRe: How to set form to maximum form... Pin
Paul Watson7-Nov-02 11:53
sitebuilderPaul Watson7-Nov-02 11:53 
GeneralRe: How to set form to maximum form... Pin
Munti7-Nov-02 12:14
Munti7-Nov-02 12:14 
GeneralProblem with .NET and W2K Pin
Marc Clifton7-Nov-02 11:00
mvaMarc Clifton7-Nov-02 11:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.