Re: How to omit blank spaces in the text?
- From: chris-university student <chrisuniversitystudent@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 24 Apr 2008 03:38:01 -0700
hey,,,,i've got the same problem...with spaces
only that the compiler doesn't recognise neither Trim or Replace...
has something to do with libraries?
"Dave O." wrote:
In this context a hash can be a number formed from the ASCII values of each.
character and the positions of each character, the idea is that you will get
a different number for the same characters in a different order. The maths
should throw away some of the numbers (normally the most significant
figure(s)) so that it is impossible to reverse the maths to get the original
plaintext. This is very different from encryption where you do need to get
the original plaintext back.
When the password is first created you calculate the hash and store that,
then to test a password you use the same routine to calculate the hash of
the entered password then compare that with the stored hash, if they match
then it is almost certain the entered password is correct. I say "almost"
because most hash routines will return a long so there are only just over 4
billion possible hashes but an infinite number of potential passwords or
phrases, hence in theory it is possible for a wrong password to work but the
odds are about 4,000,000,000 to 1 against, so I don't lose a lot of sleep
over it.
Another advantage is that you are just storing a number so the user can have
as long a password or pass-phrase they want. Pass-phrases are good because
they can be really long and still easy to remember.
As for the actual hash routine, have a look around, some people may suggest
some or there should be some available on the net.
Regards
Dave O.
"Ruslan" <Ruslan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:294B3C16-F1D3-48F6-A131-8E97630B1C90@xxxxxxxxxxxxxxxx
Dear Dave,
I need some clarification on the following :
'
You should create a non-reversible hash from the password, store that and
then compare it to the hash of the entered password.
'
Could you clarify for me how does it work in detail?
"Dave O." wrote:
If you are just trying to remove spaces from a string, this will do the
job
Replace(Text1.Text," ","")
Another point is that storing the passwords as clear text in the database
is
so insecure that it's so trivial to circumvent it's almost a joke.
You should create a non-reversible hash from the password, store that and
then compare it to the hash of the entered password.
As for spaces in a password, there is no real reason to exclude them from
inside a password, only exclude them from the start or end of the
password,
in which case Trim(Text1.Text) would remove any spaces fore & aft.
Regards
Dave O.
"Ruslan" <Ruslan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E09C61BB-0A8E-4072-981F-8990517CB210@xxxxxxxxxxxxxxxx
Please assist in solving the following problem.
In text1 field (max length is e.g. 20) User entered some password with
the
length e.g. 12.
AT the same time I have the list of all passwords in SQL database.
When VB checks text1 field with the database it compares ...
(123456..............) with (123456)
as a result it says that password is not correct.
Is there any way to omit blank spaces (..............) whenever they
appear
after an entered password in text1?
- Follow-Ups:
- Re: How to omit blank spaces in the text?
- From: Bill McCarthy
- Re: How to omit blank spaces in the text?
- From: Dave O.
- Re: How to omit blank spaces in the text?
- Prev by Date: Re: VBA sending/reading from a running program
- Next by Date: Re: How to omit blank spaces in the text?
- Previous by thread: VBA sending/reading from a running program
- Next by thread: Re: How to omit blank spaces in the text?
- Index(es):
Relevant Pages
|