|
-
Jun 19th, 2010, 07:31 PM
#30
Member
Re: [RESOLVED] How to Write an encripted Text File???
This is how i solved it:
First I googled a hashing algorithm (I found one which is one way hashing algorithm)
Then I created a username and password, and stored the raw username and the hashed password and an access number (will tell you how i calculated this number)
When you login just hash the password and compare the username and hashed passwords combination. if they match resolve the access number.
The access number was calculated in the following way (this can be done in various ways but its the most foolproof idea i had)
I made a string with all alphabet both caps, lower case and numbers. Then I go through the username letter by letter and search for it in that alphanumeric string, adding the position in the string it is found to a variable. When all username is added up i add 4 for admin rights, 8 for level 1, 16 for level 2 and so on and so forth. to find access level when you login just perform the strign search of the username and subtract the number read from the file to the total added. if it's 4 give him admin rights, 8 levle 1 etc etc
this way even if they try to hash a password or leave it empty or something they still have to crack the "encryption" behind the access number...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|